Question

In: Computer Science

What does DOWHILE mean?


What does DOWHILE mean?

Solutions

Expert Solution

>Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop in C programming language checks its condition at the bottom of the loop.
>A do...while loop is similar to a while loop, except that a do...while loop is guaranteed to execute at least one time.
The syntax of a do...while loop in C programming language is:
do
{
statement(s);
}
while( condition );
>The conditional expression appears at the end of the loop, so the statement(s) in the loop execute once before the condition is tested
>If the condition is true, the flow of control jumps back up to do, and the statement(s) in the loop execute again. This process repeats until the given condition becomes false.

Example Program:

#include <stdio.h>
int main ()
{
/* local variable definition */
int a = 10;
/* do loop execution */
do
{
printf("value of a: %d\n", a);
a = a + 1;
}
while( a < 20 );
return 0;
}


Related Solutions

What does it mean to have a good life? What does it mean to be a...
What does it mean to have a good life? What does it mean to be a good person?
What does it mean to be "modern" biologically and culturally? What does it mean to be...
What does it mean to be "modern" biologically and culturally? What does it mean to be human? Antropology 101
What does it mean to be operating a firm in the "long run?"  What does it mean...
What does it mean to be operating a firm in the "long run?"  What does it mean to be operating a firm in the "short run"?  What are the practical implications for managing a business if you are in "short run?"
What does it mean to have a critical lens? What does it mean to have a...
What does it mean to have a critical lens? What does it mean to have a gender/sex lens?
What does convergence of Technology mean to Apple? What does it mean to the customers?
What does convergence of Technology mean to Apple? What does it mean to the customers?
what does the acronym SBAR mean? what does the acronym ISBARR mean?
what does the acronym SBAR mean? what does the acronym ISBARR mean?
What does percent abundance mean? What does relative abundance mean? What is the difference?
What does percent abundance mean? What does relative abundance mean? What is the difference? 
What does it mean for a catalog to be self-describing? What does the following query mean?
DBMS:What does it mean for a catalog to be self-describing? What does the following query mean?((TABLES JOIN COLUMNS) WHERE COLCOUNT < 3) [TABNAME, COLNAME]
1. In Java, what does the last line mean? What does scan.nextLine(); mean?
1. In Java, what does the last line mean? What does scan.nextLine(); mean?import java.util.Scanner;Scanner scan = new Scanner (System.in);message = scan.nextLine();2. Assuming that a Random object has been created called generator, what is the range of the result of each of the following expressions? Also, do each example using nextFloat()•generator.nextInt(20)•generator.nextInt(8) + 1•generator.nextInt(100) – 50
What does Performance Excellence mean to Healthcare organizations and what does it mean to you as...
What does Performance Excellence mean to Healthcare organizations and what does it mean to you as a patient?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT