Looping


In computer programming, a loop is a sequence of commands or statements that are repeated many times.

Looping statements in C language

C language provides following looping statements:
  • for statement
  • while statement
  • do…while statement

Let us learn C programming Looping concept by executing following programs.


C programs based on for loop


C programs based on while loop

C programs based on do…while loop


Sample Program based on Looping concept



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

Output of program

1 2 3 4 5 6 7 8 9 10




* * * * *

Basic Concepts  Back to Home  Branching Statements


2 comments:

  1. Replies
    1. Dear visitor,

      Looping means: "In computer programming, a loop is a sequence of commands or statements that are repeated many times".

      Delete