Question: Prompt the user to enter an integer Then, prompt the user to enter a positive integer n2. Print out all the numbers that are entered

Prompt the user to enter an integer

Then, prompt the user to enter a positive integer n2.

Print out all the numbers that are entered after the last occurrence of n1 and whether each one is even or odd

If n1 does not occur or there are no values after the last occurrence of n1, print out the message as indicated in the sample runs below.

Sample:

Enter n1: -2

Enter n2: 7

Enter 7 values: -2 3 3 -2 4 3 6

4 is even

3 is odd

6 is even

Enter n1: 100

Enter n2: 6

Enter 6 values: 101 2 -7 100 9100

No values after 100

Enter n1: 5

Enter n2: 3

Enter 3 values: 4 5 104

9 does not occur

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!