226k views
3 votes
Write a function that gives the product of two numbers in c language​

User Imprezzeb
by
4.7k points

2 Answers

5 votes

Step-by-step explanation:

printf("Enter two numbers: "); scanf("%lf %lf", &a, &b);

Then, the product of a and b is evaluated and the result is stored in product.

product = a * b;

Finally, product is displayed on the screen using printf().

printf("Product = %.2lf", product);

Notice that, the result is rounded off to the second decimal place using %.2lf conversion character.

User Khb
by
4.4k points
2 votes
Program to Multiply Two Numbers
printf("Enter two numbers: "); scanf("%lf %lf", &a, &b); Then, the product of a and b is evaluated and the result is stored in product . product = a * b; Finally, product is displayed on the screen using printf() .
User Teodron
by
4.4k points