For Loop in C language
When you know how many times you want to repeat a block of code, you use the for loop. It consists of three parts: initialization, condition, and iteration.
Syntax:-
for (initialization; condition; iteration) {
// Code write here
}
example:-
#include <stdio.h>
int main() {
// The numbers from 1 to 5 will be printed by this for loop.
for (int i = 1; i <= 5; i++) {
printf("%d\n", i);
}
return 0;
}