Basic

Switch Case

Goto

Operators

if Statement

Nested if

While Loop

For Loop

Array

Patterns

Excersises


Basic for loop in c program


A For Loop is used to repeat a specific block of code a known number of times.This is one of the most frequently used loop in C programming.

Example : pgm.c

#include<stdio.h>
int main(){
    int i;
    for(i=0;i<10;i++)
    {
        printf("\n%d",i);
    }
    return 0;
}

Output:

0
1
2
3
4
5
6
7
8
9