Question: Write a code segment which reads in an integer value n from the console, and then uses a loop to print n lines like these:

Write a code segment which reads in an integer value n from the console, and then uses a loop to print n lines like these:

I Am Line #<1>

I Am Line #<2>

I Am Line #

I Am Line #

reflects the value of n. The program should print an error message if n is less than one or greater than 1000. Assume that the console input provided contains a correct representation of an integer value.

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!