Computer Science, asked by kmrkpavan, 3 months ago

Write a Program of adding two numbers as well as multiplying two numbers?​

Answers

Answered by amanpandey1980
0

Answer:

SEE THIS

Explanation:

#include <iostream>

using namespace std;

int main(){

   char op;

   double num1,num2;

   cout << "Enter the operator ( +,*) ; ";

   cin >> op;

   cout << "Enter two numbers one by one : ";

   cin >> num1 >> num2;

   switch( op ){

    case '+':

        cout << num1 << "+" << num2 << "=" << (num1 + num2);

        break;

     case '*':

        cout << num1 << "*" << num2 << "=" << (num1 * num2);

        break;

      default:

      cout << op << "is an invalid operator";

   }

   

   return 0;

}

Answered by harshika10y
0
Adding numbers

Start
Ask which is the first number
Ask which is the second number
Answer1 + Answer2 = Variable
The sum of the two numbers is variable.
Stop



Multiplying Numbers

Start
Ask which is the first number
Ask which is the second number
Answer1 multiplied by Answer2 = Variable
The product of the two numbers is variable.
Stop
Similar questions