C program to multiply two floating point numbers
belongs to collection: C programs - Basic C Programs
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
belongs to collection: C programs - Basic C Programs
total answers (1)
C program to multiply two floating point numbers - Source code
Program Output
Program Explanation
1. In this program, user is asked to enter two numbers one by one. These two numbers entered by the user are stored in the floating type variables number1 and number2. This is done using scanf() function.
2. Then, the product of number1 and number2 is evaluated and the result is stored in another floating type variable product.
3. Finally, the value of variable product is displayed on the screen using printf() function.
4. Here note that %.3f is used instead of regular %f format specifier. This is to limit the product result up to three decimal places.
need an explanation for this answer? contact us directly to get an explanation for this answer