0 like 0 dislike
57 views
in Computer Science by (1.0m points)
Write the syntax of do-while loop.

1 Answer

0 like 0 dislike
by (1.0m points)
Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop in C programming checks its condition at the bottom of the loop.

A do...while loop is similar to a while loop, except the fact that it is guaranteed to execute at least one time.

Syntax

The syntax of a do...while loop in C programming language is −

Notice that the conditional expression appears at the end of the loop, so the statement(s) in the loop executes 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 executes again. This process repeats until the given condition becomes false.

Related questions

0 like 0 dislike
0 answers 52 views
0 like 0 dislike
1 answer 71 views
asked Nov 9, 2018 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 41 views
asked Feb 12, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 68 views
asked Feb 14, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
0 answers 53 views
0 like 0 dislike
1 answer 39 views
asked Feb 12, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 38 views
asked Feb 11, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 56 views
0 like 0 dislike
1 answer 67 views
0 like 0 dislike
1 answer 43 views
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute: School, College, University, Academy Free Homework Help

19.4k questions

18.3k answers

8.7k comments

6.3k users

Free Hit Counters
...