C++ Programming ( Simple Calculator Code)♦♦♦♦

Words
75
Reading
1 min
Listen
Play
9y

// SImple Calculater

 #include <iostream.h>
 using namespace std;
  int main()
  {
system ("color f9");

    double num, den, result; //declear funcatin

       char op; // declear the opreaters "+,_,*,/"
     do{ // mean that loop working when 
     cout<< "\n\t\tEnter the Number"<<endl;// User disply show 
       cin>> num; // user input
       cout<<"\n\t\tEnter opreater +.-,*,/:"<<endl;//user disply show
        cin>>op; // user input
          cout<< "\n\t\tEnter the Second Number"<<endl; //user disply show
     cin>>den;// user input
    // Now when user want addation/multipaction/subtaractin/dividing user press the 
    //button "+,*,-,/"so result show input number then opreater
        if(op=='+')result=num+den;
         if(op=='-')result=num-den;
           if(op=='*')result=num*den;
         if(op=='/')result=num/den;
        // Here any opreation work display screen result
          cout << result << endl;
    
       }// while 
         while (op!='e');
       return 0;
       }
C++ Programming ( Simple Calculator Code)♦♦♦♦ | Ecency