for loop in C


The for loop is a loop which is mostly used in any programming languages.
because for loop is easy to use and understand.
For loop is used to repeate a specific block of code a known number of times.

Let's understand with the syntax of for loop-






   Example: program to print series of  1  to 10 numbers using  for loop.


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

Above program shows the following Output:



No comments:

Post a Comment

If you have any doubts, please discuss here...👇