The following program skeleton asks the user for two numbers and then multi-plies them. The first should be negative and the second should be positive. Write the input validation code for both numbers.
#include
using namespace std;
int main()
{
int first, second, result;
cout << "Enter a negative integer: ";
cin >> first;
cout « "Now enter a positive integer: ";
cin >> second;
//
// Write input validation code
//
result = first * second;
cout « first << " times '1 << second « " is " « result « endl;
return 0;
}
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.