View on GitHub How to write “while” loop in C programming language? While Loop On this page On this page While Loop Output ❮ Previous Next ❯ While Loop #include <stdio.h> int main() { int i = 1; while (i <= 5) { printf("%d\n", i); i++; } return 0; } Output 1 2 3 4 5 ❮ Previous Next ❯