MENU DRIVEN TO PERFORMED ARITHMETIC OPERATION



#include<iostream.h>
#include<conio.h>
void main ()
{
int m,n,c,r;
clrscr();
   cout<<"\n Enter First Number ";
   cin>>m;
   cout<<"\n Enter Second Number ";
   cin>>n;
   cout<<"\n------------------";
   cout<<"\n1. Addition";
   cout<<"\n2. Subtraction";
   cout<<"\n3. Multiplication";
   cout<<"\n4. Division";
   cout<<"\n5. Remainder";
   cout<<"\n------------------";
 cout<<"\n Enter UR Choice ";
 cin>>c;
 cout<<"\n------------------";
switch(c)
{
   case 1 :
      r=m+n;
      cout<<"\nAddition = "<<r;
      break;
   case 2 :
      r=m-n;
      cout<<"\nSubtraction = "<<r;
      break;
   case 3 :
      r=m*n;
      cout<<"\nMultiplication"<<r;
      break;
   case 4 :
      r=m/n;
      cout<<"\n Division"<<r;
      break;
   case 5 :
      r=m%n;
      cout<<"\n Remainder"<<r;
      break;
   default :
      cout<<"\n Invalid";
}
cout<<"\n------------------";
Output 

No comments:

Post a Comment

JAC Board Computer || IIT 2025 || Introductory Information Technology || Class 10 || Practical Examination 2025

Marks Division HOE 30 Marks IT Application Report File 20 Marks Viva - Voce 10 Marks 1) Write an HTML code to generate a web p...