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

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials 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 Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz