Write a program that will use a counter-controlled loop to


Question: Task #1: Counter controlled loop

a). Write a program that will use a counter-controlled loop to display the first 50 numbers

b). Modify the program to prompt the user for a number. Starting with that number, use the counter controlled loop to display 50 numbers beginning with the number the user keyed in.

Task #2: Sentinel Controlled loop

Sentinel controlled loop with numbers

Modify the program to prompt the user to input a list of numbers. Display the number enter to the user .To end entering the list in the input the user must enter -1 as the sentinel value that will terminate the loop.
Sentinel controlled loop with strings

Modify the program to prompt the user to input a list of names. Display the name enter to the user .To end entering the list in the input the user must enter an * as the sentinel value that will terminate the loop.

Task #3: EOF controlled loop

Modify the program in task #1 to write on the first 50 numbers to a file name numbers.txt. Afterwards, open the file as an input-file and use the EOF to control your loop.Display the records read from the file to the screen.After the EOF returns the value of true, the loop will terminate.

Request for Solution File

Ask an Expert for Answer!!
Data Structure & Algorithms: Write a program that will use a counter-controlled loop to
Reference No:- TGS02280106

Expected delivery within 24 Hours