WHILE LOOP Syntax of for loop is
while (condition) {
// code block to be executed
}
NOTE
Note: Do not forget to increase the variable used in the condition (i++), otherwise the loop will never end!
Program
INPUT
#include <stdio.h> main() { int i = 0; while (i < 5) { printf("%d\n", i); i++; } getch(); }
OUTPUT
![]()