Question: For this question you can modify the answer to question 1. Write a program that takes in three inputs, The first is a numeric input,
For this question you can modify the answer to question 1. Write a program that takes in three inputs, The first is a numeric input, the next is char, the final is another numeric input. The second input must be char that is '+', '-', '*', or '/' if it is any other char it MUST be rejected. The second input is used as the operator and the first and third input, the operands. The program will then print the result of the operator applied to the first and third input, then exit. C++
Question 1.
#include "stdafx.h"
#include using namespace std;
int main()
{
int firstNum; int secNum; cout << "Enter the first numbers ";
cin >> firstNum; cout << "Enter the second numbers " << endl;
cin >> secNum;
cout << "The values you entered is "<< firstNum * secNum<< endl;
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
