Answer :
#include<stdio.h> //header file contains the function,decleraction and macro defination of key words used in code.
int main ()
{
int num1,num2,op; //adressing the variables
printf("Enter the First number : "); //output
scanf("%d",&num1); //stores the input from the user
printf("Enter the second number : "); //output
scanf("%d",&num2); //stores the input from the user
printf("Enter the number of operator you want to perform your task \n1.'+'\t\t2.'-'\n3.'/'\t\t4.'*'\n"); //output
scanf("%d",&op);
switch (op)
{
case 1 :
printf("The Addition of the two numbers are %d",num1+num2); //output
break;
case 2 :
printf("The Subraction of the two numbers are %d",num1-num2); //output
break;
case 3 :
printf("The division of the two numbers are %d",num1/num2); //output
break;
case 4:
printf("The Multiplication of the two numbers are %d",num1*num2); //output
break;
default :
printf("you enter a wrong choice"); //output
break;
}
}
Output :
0 Comments