Program to Multiply Two Floating-Point Numbers

Write a Program to Multiply Two Floating-Point Numbers.


C Program

#include <stdio.h>
int main()
{
    float firstNumsecondNum;

    printf("Enter first number : ");
    scanf("%f", &firstNum);

    printf("Enter second number : ");
    scanf("%f", &secondNum);

    float product = firstNum * secondNum;

    printf("Product is %f "product);

    return 0;
}
Input:
Enter first number : 12.5
Enter second number : 56.34

Output:

Product is 704.250000 


No comments:

Post a Comment