Question: Having trouble with a portion of my code. The output is correct when values are greater than or equal to 1. However when an invalid

Having trouble with a portion of my code. The output is correct when values are greater than or equal to 1. However when an invalid value is entered, my code fails to execute as desired. Please help if possible, my brain is not working properly.

I'll post my code as well as the issue I am encountering.

Code:

#include #include

using namespace std;

int main() { int N; cout > N; while (N> N; } int i; for (i=1; i

return 0; } // end main()

Issue:

Having trouble with a portion of my code. The output is correct

1 2 3 4 5 6 7 8 9 Your output: N value (must be greater than or equal to 1)? Differences: 1c1,10 8 >9 Found differences

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!