Question: write in C language Write a program that asks the user for integers and, for each integer, prints a number of stars that's equal to
Write a program that asks the user for integers and, for each integer, prints a number of stars that's equal to the integer. If the user enters a negative integer, the program should display an error message. The user ends the program by entering the sentinel of -1. The outputs should be labeled like in the sample below (Output 1, Output 2, ...). The count should not update if the integer is invalid. What's the suitable loop structure for this program? Enter an integer: 4 Output 1: **** Enter an integer: 10 Output 2: ****** Enter an integer: -3 Invalid input! Enter an integer: 8 Output 3: ******** Enter an integer: -1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
