Showing Page:
1/2
A C language program for making calculator :
#include <stdio.h>
int main ()
{
int choice,a,b,result;
printf("2 Subtraction\n");
printf("3 Multiplication\n");
printf("4 Division\n");
scanf("%d",&choice);
switch (choice)
{
case 1:
printf("Enter two numbers");
scanf("%d %d", &a , &b);
result=a+b;
printf("Sum of two numbers is %d",result);
case 2:
printf ("Enter two numbers");
scanf("%d %d",&a,&b);
result=a-b;
Showing Page:
2/2
printf("Subtraction of two numbers is %d",result);
break;
case 3:
printf("Enter two numbers");
scanf("%d %d",&a,&b);
result=a*b;
printf("Multiplication of two numbers is %d",result);
break;
case 4:
printf("Enter two numbers");
scanf("%d %d",&a,&b);
result=a/b;
printf("Division of two numbers is %d",result);
break;
}
return 0;
}

### Unformatted Attachment Preview

A C language program for making calculator : #include int main () { int choice,a,b,result; printf("1 Addition\n"); printf("2 Subtraction\n"); printf("3 Multiplication\n"); printf("4 Division\n"); printf("\nEnter your choice\n"); scanf("%d",&choice); switch (choice) { case 1: printf("Enter two numbers"); scanf("%d %d", &a , &b); result=a+b; printf("Sum of two numbers is %d",result); case 2: printf ("Enter two numbers"); scanf("%d %d",&a,&b); result=a-b; printf("Subtraction of two numbers is %d",result); break; case 3: printf("Enter two numbers"); scanf("%d %d",&a,&b); result=a*b; printf("Multiplication of two numbers is %d",result); break; case 4: printf("Enter two numbers"); scanf("%d %d",&a,&b); result=a/b; printf("Division of two numbers is %d",result); break; } return 0; } Name: Description: ...
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4