May 29, 2020

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 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:


Share This:    Facebook Twitter

0 comments:

Post a Comment

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