Computer Science, asked by abhishek1008jha, 9 months ago

programming in C++ of Calculator​

Answers

Answered by Dhruv11Pratap
3

A simple calculator can be made using a C++ program which is able to add, subtract, multiply and divide, two operands entered by the user. The switch and break statement is used to create a calculator.

Hope it's help you

Make me on Brainlist....

Answered by AbdelrhmanW
0

Answer:

Try this code

Explanation:

#include <iostream>

using namespace std;

int main() {

  float x,y;

  char o;

  cout<<"enter the first number\n";

  cin>>x;

  cout<<"enter the operation sympol\n";

  cin>>o;

  cout<<"enter the second number\n";

  cin>>y;

  switch(o){

      case '+': cout<<x+y; break;

      case '-' : cout<<x-y; break;

      case '*' : cout<< x*y; break;

      case '/' : cout<<x/y; break;

  }

   return 0;

}

Similar questions