1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What is loop

Discussion in 'C' started by techinspiration, Apr 26, 2010.

  1. techinspiration

    techinspiration New Member

    Joined:
    Feb 14, 2010
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    0
    Hi
    i am a student and i have a question that what is loop.
     
  2. techme

    techme New Member

    Joined:
    Feb 15, 2010
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    0
    A loop is used to repeat a piece of code until some condition is met.
     
  3. cb92

    cb92 New Member

    Joined:
    Jul 28, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Sometimes you need to do a series of actions for a number of times, or until some condition is met. The code written for that purpose is called a loop.
     
  4. ksrao

    ksrao New Member

    Joined:
    Aug 10, 2010
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    0
    LOOP:
    In looping, a sequence of statements are executed until some conditions for the termination of the loop are satisfied.

    loop contains two parts
    1. Body of the Loop
    2. Control statement

    in C-language there are three constructs for Loops
    1.The While loop
    2. The Do ..While loop
    3. The For Loop

    1.While ( Condition)
    {


    Body
    };

    2.Do
    {


    Body

    }
    While (condition);

    3.for ( i=1;i<=100;i++)
    {

    Body
    }

    try some online tests at wiziq dot com that will help to build your knowledge.

    Kolla Sanjeeva Rao
     

Share This Page