- While loop: The 
whileloop continues executing the block of code as long as the condition remains true. The condition is evaluated before entering the loop, so if it’s false initially, the code inside the loop may not execute at all. 
Syntax:
while(condition) {
// code to execute
}
Example:
int i = 0;
while(i < 5) {
printf(“i = %d\n”, i);
i++;
}
Output:
i = 0
i = 1
i = 2
i = 3
i = 4
- Do-while loop: Unlike the 
whileloop, thedo-whileloop evaluates the condition after executing the loop body. Therefore, the loop executes at least once, even if the condition is false initially. 
Syntax:
do {
// code to execute
} while(condition);
Example:
int i = 0;
do {
printf(“i = %d\n”, i);
i++;
} while(i < 5);
Output:
i = 0
i = 1
i = 2
i = 3
i = 4