C Language

May 20, 2023

How to use for Loop in C Language

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 
  1. Created a variable named i inside the integer, initialized i=1 inside the for loop that i++ will continue to happen until the value of i becomes 5

by : Nadeem Khan

Quick Summary:

For Loop