Knowledge Walls
Venkatesan
Hyderabad, Andhra Pradesh, India
Passcode:
Introduction [cont'd]
Input Output Functions [cont'd]
Structures and Unions [cont'd]
# Preprocessor [cont'd]
Do-While in Looping Statements of Programming in C
1908 Views
Do-While 
Do-While is also a looping statement. Block of statement getting executed till the condition is getting false.

But different between while and do-while is
Do-While: checks the condition after block of statement get executed. So if the condition is false also this block will get executed atleast once.
While: checks the condition before executing block of statement. So if the condition is true only will get execute.
Syntax 
do {
   statements;
} while(condition or expression);
Program
#include
void main(){
    int i = 8;
    do {
        printf("I = %d",i);
        i++;
    } while(i <= 5);
}
Output 
I = 8
Next Topics
Next lessons of current book.
Looping Statements of Programming in C
Looping Statements of Programming in C
Previous Topics
Previous lessons of current book.
Looping Statements of Programming in C
Looping Statements of Programming in C
Decision Statements of Programming in C
Decision Statements of Programming in C
Decision Statements of Programming in C
Best Lessons of "Programming in C"
Top lessons which are viewed more times.
Structures and Unions of Programming in C
Input Output Functions of Programming in C
Structures and Unions of Programming in C
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details