How do I use do-while statement?
Category: Introduction, viewed: 152 time(s).
The do-while executes a statement or a block of statement inside the {} until the condition defined in the while statement has a false value. The block will be executed at least one time in the program execution because the conditional check is done a the end of the block.
In the following example the do-while statement prints an asterisk character as long as the variable i has a value less than 10.
And here is the result of our program:
* * * * * * * * * *
Download Hundreds of Complimentary Industry Resources
Get hundreds of popular Industry magazines, white papers, webinars, podcasts, and more;
all available at no cost to you. With more than 600 complimentary offers, you'll find
plenty of titles to suit your professional interests and needs.
Click Here and Sign up today!