do while Loop in C Programming
In this lesson, we will understand what is do while loop and how it is used in C programming.
What is do while Loop
A do while loop in C programming is similar to a while loop, with the key difference that the test condition is checked at the end of the loop. This ensures that the loop body is executed at least once before the condition is tested. This is useful when we want to run the loop body at least one time, regardless of the condition.
do {
// Body of the loop
} while (condition);
- Body of the loop: The loop body is executed first, and then the condition is checked.
- condition: If the condition is true, the loop body is executed again. This process repeats until the condition becomes false.
Unlock This Lesson & Start Learning!
Get full access to this lesson, practical exercises, quizzes, and your Mentora AI Tutor.
Special Offer, use coupon code DWL6BC to get additional discount of 10% on all subscription. Hurry limited time offer.
1 Month
Renews at ₹259/month.
Manual renewal required.
No automatic charges.
- Premium lessons access
- Quizzes and exercises
- Mentora AI Tutor
3 Months
Equivalent to ₹219.67/month.
Manual renewal required.
No automatic charges.
- Premium lessons access
- Quizzes and exercises
- Mentora AI Tutor
6 Months
Equivalent to ₹193.17/month.
Manual renewal required.
No automatic charges.
- Premium lessons access
- Quizzes and exercises
- Mentora AI Tutor
12 Months
Equivalent to ₹179.92/month.
Manual renewal required.
No automatic charges.
- Premium lessons access
- Quizzes and exercises
- Mentora AI Tutor