Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the program for this problem using a while loop construct, and the code as described: Write a program that will count down from 20

Implement the program for this problem using a while loop construct, and the code as described: Write a program that will count down from 20 to 5 inclusive and display the count on the Console by performing the following Declare a variable of int data type with a name of your choice. Assign the appropriate initial value to the variable that you declared. Use a while loop construct that will loop around based on the appropriate test condition involving the variable that you declared. In the statements below, variable name refers to the name of your variable, which you declared for use in counting down. The body of the while loop should contain program statements that will perform the following: Display the text variable name followed by the value of the variable on the Console display. Create a Delay of 800 milliseconds using the KISS statement msleep ( );A program statement that will Modify your variable as appropriate for counting down Also display the text Count is smaller than 10 when the count is less than 10, otherwise display the text Count is large Additionally, display the text Count is now 16 when the count is exactly 16 Your program will display Excellent on the next line of the Console display after the while loop is exited.

C language. I did the loop but need help with the Bold Italic part

int main() { int counter; counter = 20; while (counter >=5) { printf("counter is %d ", counter); counter = counter - 1; msleep(800); } printf("Excellent "); return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions