About Me

Hey friends! My name is yuvraj basnet. I'm going to introduce myself.I have born and grown up in india(chandigarh) and I'm studying second year of B.C.A computer science field. My father serving in indian air force. My mother has been taking care of house hold. I am a friendly person, good thinker, I can work for longer hours without any break, only if I'm interested in that...My life style is very simple.

C LOOPS

Loops are used in programming to repeat a specific block of statements (iteration)
After reading this tutorial, you will learn to create for loop, while loop
and do while loop in C programming.     

              

                                       LOOP

The process of repeatedly executing a collection of statement is called looping.
Loops are used in programming to repeat a block of statements until a specific condition is satisfied. 

There are three loops in C programming:

1)for loop
2)while loop 
3)do while loop

1)for loop: for loop is used to execute a set of statements repeatedly until a particular condition is satisfied.

   SYNTAX:

   Example:

    OUTPUT


2)while loop: If the test expression is true, statements inside the body of while loop is executed. The test expression is evaluated again. The process goes on until the test expression is false. 
while loop is also known as entry control loop.

    SYNTAX:
    
    EXAMPLE-

    OUTPUT

3)do while loop: It is necessary to execute body of the loop before testing the condition. Such situations can be met with the help of do while loop.
do while loop is also known as exit control loop.

   SYNTAX:

     EXAMPLE-
 



    OUTPUT

 



     










Post a Comment

0 Comments