Problem In Hand
C Program to take input for three numbers calculate and print their product
Process and Solution Of Problem
- Take input for three numbers and store them in three different variables
- calculate and store product of the number in a fourth variable
- further display the result
Program/Source Code
int main()
{
int a,b,c,d;
printf("Enter 1st no ");
scanf("%d",&a);
printf("Enter 2nd no ");
scanf("%d",&b);
printf("Enter 3rd no ");
scanf("%d",&c);
d=a*b*c;
printf("Product = %d",d);
return 0;
}
Program Explanation
On execution of the program
* user enteres the first number and it is stored in a variable “a”
* user enteres the second number and it is stored in a variable “b”
* user enteres the third number and it is stored in a variable “c”
* further calculation is performed and product of values stored in “a” ,”b” and “c” are stored in a variable “d” i.e. c=a*b*c;
* then the result is displayed on the screen
Output:
Enter 1st no 2 Enter 2nd no 3 Enter 3rd no 5 Product = 30
You May Also Like:
C Program to find lowest of 3 numbers
C Program to print factorial of a number
C program to check number is even, odd or zero
C program to check a character is an alphabet or not
C program to convert total meters to km and m
| <<< Previous: Sum Of Two Numbers | Square and Cube of a Number : Next >>> |
Tutorials | Technical Questions | Interview Questions |
|---|---|---|
|
C Programming C++ Programming Class 11 (Python) Class 12 (Python) |
C Language C++ Programming Python |
C Interview Questions C++ Interview Questions |




