May 20, 2023
Program to use for Loop in C Language
#include <stdio.h>
int main()
{
int i;
for (i = 1; i <= 5; i++)
{
printf("%d\t", i);
}
printf("\n");
return 0;
}
output
1 2 3 4 5
- Created a variable named i inside the integer, initialized
i=1
inside the for loop thati++
will continue to happen until the value ofi
becomes5
by : Nadeem Khan
Quick Summary:
For Loop