a loop in c code example
Example 1: for loop in c
int i;
for (i = 0; i < n; ++i) { // n is the number of iterations
// Code here
}
Example 2: c make loop
// Print numbers from 1 to 5
#include <stdio.h>
int main()
{
int i = 1;
while (i <= 5)
{
printf("%d\n", i);
++i;
}
return 0;
}