RUPAK SEARCH ENGINE

Custom Search

Write a program to input two numbers and find its sum, product, difference and division

Write a program to input two numbers and find its sum, product, difference and division
#include
#include
void main()
{
int a,b,choice;
clrscr();
printf("Enter first numbe:");
scanf("%d",&a);
printf("Enter second number:");
scanf("%d",&b);
printf("\n\n\n\nChoose the number\n");
printf("\n1 for add\n2 for subtract\n3 for multiple\n4 for divide\n");
scanf("%d",&choice);
switch (choice)
{
case 1:
printf("Sum=%d",a+b);
break;
case 2:
printf("Difference=%d",a-b);
break;
case 3:
printf("Product=%d",a*b);
break;
case 4:
printf("Quotient=%d",a/b);
break;
};
printf("\n Thank you");
getch();
}

No comments:

Post a Comment