#include <stdio.h>
int main()
{
int ch,a,b,c;
float d;
printf("\n1.Addition\n2.Subtraction\n3.Multiplication\n4.Division"); (Display the option)
printf("\nEnter the Two number :");
scanf("%d%d", &a, &b);
printf("\nEnter your choice :");
scanf("%d", &ch);
switch(ch)
{
case 1:
c = a+b;
printf("\nAddition : %d",c);
break;
case 2:
c = a-b;
printf("\nSubtraction : %d",c);
break;
case 3:
c = a*b;
printf("\nMultiplication : %d",c);
break;
case 4:
d = a/b;
printf("\nDivision : %f",d);
break;
default:
printf("\nInvalid number ");
break;
}
return 0;
}
Comments
Post a Comment