Programming Examples

Write a program enter only the three numbers and calculate their sum and multiplication


Write a program enter only the three numbers and calculate their sum and multiplication?

Solution

#include<stdio.h>
void main()
{
int a,b,c,x;
clrscr();
printf(“\nEnter Three Numbers:”);
x=scanf(“%d %d %d”,&a,&b,&c);
if(x==3)
{
 printf(“\n Addition : %d”,a+b+c);
 printf(“\n Multiplication : %d”, a*b*c);
}
getch();
}
Output

Enter Three Numbers: 1 2 4

Addition : 7

Multiplication : 8

After second time execution

Enter Three Numbers: 5 v 8

Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Best Website and Software Company in Allahabad