Wap in cpp for simple calculator by using switch statement

#include<iostream.h>
#include<conio.h>
Void main()
{
int a,b,c,d
Cout<<”enter the value of two variable”;
Cin>>a>>b;
Cout<<”select the operation to be performed on numbers\n 1.multification \t 2.division\n 3.addition \t 4.subtraction”;
Cin>>d;
Switch(d)
{
Case 1:
C=a*b;
Break;

Case 2:
C=a/b;
Break;

Case 3:
C=a+b;
Break;

Case 4:
C=a-b;
Break;

Default:
Cout<<”please select appropriate operation”;
Break;

}

Cout<<c;
}

No comments:

Post a Comment

If You Like The Post Or want to Add Something More
then feel free to comment