Write a Program of adding two numbers as well as multiplying two numbers?
Answers
Answered by
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
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
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
Math,
1 month ago
Math,
3 months ago
Computer Science,
3 months ago
Math,
10 months ago
English,
10 months ago