You are on page 1of 3

INPUT #include<iostream.h> #include<conio.h> #include<math.

h> void main() { int var1,var2,ans,ch; float sq; clrscr(); cout<<"\t\tEnter any one serial no out of the following\n\t\t1. Addition\n\t\t2. Subtraction\n\t\t3. Multiplication\n\t\t4. Division"; cout<<"\n\t\t5. Square\n\t\t6. Raise to\n\t\t7. Square root\n"; cin>>ch; switch(ch) { case 1: cout<<"Enter any two variables"; cin>>var1>>var2; ans=var1+var2; cout<<"The addition of the two value is:"<<ans; break;

case 2: cout<<"Enter any two variables"; cin>>var1>>var2; ans=var1-var2;

break. cout<<"The multiplication of the two value is:"<<ans. ans=pow(var1. cout<<"The division of the two value is:"<<ans. ans=var1/var2. case 4: cout<<"Enter any two variables". ans=var1*var2. break.cout<<"The subtraction of the two value is:"<<ans. cin>>var1>>var2. ans=pow(var1. cout<<"The square of the two value is:"<<ans. cin>>var1. cin>>var1>>var2. case 3: cout<<"Enter any two variables". case 5: cout<<"Enter any one variable". break. cin>>var1>>var2. break. . case 6: cout<<"Enter any two variables".var2).2).

cout<<"The square root is:"<<sq. } getch(). cin>>var1. Subtraction 3. Multiplication 4. break.486833 . Addition 2. case 7: cout<<"Enter any one variable". Square root 7 Enter any one variable7 The square root is:9. Raise to 7. Division 5. default: cout<<"EXIT".cout<<"The result is:"<<ans. break. Square 6. } OUTPUT Enter any one serial no out of the following 1. sq=sqrt(var1).