C Program to Multiply Two Numbers Given by User and Display Product

Program


#include<stdio.h>
#include<conio.h>

int main()
{
	float a, b, prod;
	clrscr(); // Clears the screen
	printf("Enter the value of a: ");
	scanf("%f", &a);
	printf("Enter the value of b: ");
	scanf("%f", &b);
	prod = a * b;
	printf("Product of %f and %f is %f.",a,b,prod);
	getch(); // Holds the output
	return 0;
}

Output of the above program :

Enter the value of a: 3.3 ↲
Enter the value of b: 5 ↲
Sum of 3.300000 and 5.000000 is 16.500000.


Note: ↲ indicates ENTER is pressed.