IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
Calculator in cpp
1. Calculator using switch case
#include<stdio.h>
int main()
{
int a,b,c,sum,sub,multi,divi;
printf("enter two numbers :");
scanf("%d %d",&a,&b);
printf("enter 1 to add / enter 2 to subtract / enter 3 to multiply /enter 4 to divide ");
scanf("%d",&c);
switch(c)
{
case 1: sum=a+b;
printf("sum of two numbers is %d",sum);
break;
case 2: sub=a-b;
printf("subtraction of two numbers is %d",sub);
break;
case 3: multi=a*b;
printf("multiplication of two numbers is %d",multi);
break;
case 4: divi=a/b;
printf("division of two numbers is %d",divi);
break;
default: printf("wrong input");
break;
}
return 0;
}