For loop

A for loop is a repetition control structure that allow you to efficiently write a loop that need to executes a specific number of times. It is frequently used to traverse the data structures like the array and linked list.

The syntax of for loop in C language

for(Expression 1; Expression 2; Expression 3){
//code to be executed
}

Let’s see the example of for loop:

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

Output

1
2
3
4
5
6
7
8
9
10

Submit your review
1
2
3
4
5
Submit
     
Cancel

Create your own review

The Technical Funda
Average rating:  
 0 reviews