This Link is Provided by RxLinks & it’s 100% safe!

Ads:
Click here to support us!

1
#include

int main()
{
int a, b, c, d, e, f;
printf(“Enter the first value:”);
scanf(“%d”, &a);
printf(“Enter the second value:”);
scanf(“%d”, &b);
c = a+b;
d = a-b;
e = a*b;
f = a/b;

printf(“%d + %d = %d\n”, a, b, c);
printf(“%d – %d = %d\n”, a, b, d);
printf(“%d * %d = %d\n”, a, b, e);
printf(“%d / %d = %d\n”, a, b, f);
return 0;
}

2
#include
#include
#include
int main()
{

int input,a,b,result;
char option;

do{

printf(“calculator:\n”);

printf(“\nEnter 1 for addition:\n “);
printf(“Enter 2 for subtraction:\n “);
printf(“Enter 3 for multiplication:\n “);
printf(“Enter 4 for division:\n “);

scanf(“%d”,&input);
printf(“Enter a number:\n”);
scanf(“%d”,&a);
printf(“Enter second number:\n”);
scanf(“%d”,&b);

switch(input){
case 1 : result=a+b;
printf(“The addition is : %d\n”,result);
break;
case 2 : result=a-b;
printf(“The Substraction is : %d\n”,result);
break;
case 3 : result=a*b;
printf(“The Multiplication is : %d\n”,result);
break;
case 4 : result=a/b;
printf(“The division is : %d\n”,result);
break;

default: printf(“wrong input\n”);

}
printf(“Do you want to continue ? (y/n)\n”);
option=getche();

}while(option==’y’);

return 0;
}
3
#include
#include
#include
int main()
{

int input,a,b,result;
char option;

do{

printf(“calculator:\n”);

printf(“\nEnter 1 for addition:\n “);
printf(“Enter 2 for subtraction:\n “);
printf(“Enter 3 for multiplication:\n “);
printf(“Enter 4 for division:\n “);

scanf(“%d”,&input);
printf(“Enter a number:\n”);
scanf(“%d”,&a);
printf(“Enter second number:\n”);
scanf(“%d”,&b);

switch(input){
case 1 : result=a+b;
printf(“The addition is : %d\n”,result);
break;
case 2 : result=a-b;
printf(“The Substraction is : %d\n”,result);
break;
case 3 : result=a*b;
printf(“The Multiplication is : %d\n”,result);
break;
case 4 : result=a/b;
printf(“The division is : %d\n”,result);
break;

default: printf(“wrong input\n”);

}
printf(“Do you want to continue ? (y/n)\n”);
option=getche();

}while(option==’y’);

return 0;
}
5
#include
#include
#include
int main()
{

int input,a,b,result;
char option;

do{

printf(“calculator:\n”);

printf(“\nEnter 1 for addition:\n “);
printf(“Enter 2 for subtraction:\n “);
printf(“Enter 3 for multiplication:\n “);
printf(“Enter 4 for division:\n “);

scanf(“%d”,&input);
printf(“Enter a number:\n”);
scanf(“%d”,&a);
printf(“Enter second number:\n”);
scanf(“%d”,&b);

switch(input){
case 1 : result=a+b;
printf(“The addition is : %d\n”,result);
break;
case 2 : result=a-b;
printf(“The Substraction is : %d\n”,result);
break;
case 3 : result=a*b;
printf(“The Multiplication is : %d\n”,result);
break;
case 4 : result=a/b;
printf(“The division is : %d\n”,result);
break;

default: printf(“wrong input\n”);

}
printf(“Do you want to continue ? (y/n)\n”);
option=getche();

}while(option==’y’);

return 0;
}


* This Link is 100% safe

Leave a Comment

Your email address will not be published. Required fields are marked *