Thursday, July 21, 2011

Introduction to "LOOPS" in C and C++ language

A loop is a mechanism that enables you to execute the same sequence of the statements repeatedly until a particular condition is met. The statements inside the loop is sometimes called iteration statements.

The loops can be of three types.
  1. sequential
  2. repetition
  3. section
For example you might want to.

  1. Execute a loop a given number of times.
  2. Execute the loop until a given value exceeds another value.
  3. Execute a loop until a particular character is entered.
There are Generally three types of loops in C and C++ programming language.
  1. FOR LOOP
  2. WHILE LOOP
  3. DO WHILE LOOP
We use all these loops to save the time and efforts of the programmer because other wise if we want to write something ten times in the C or C++ program than we have to write it ten times but with the help of loop we will only have to write it once and apply the loop and rest of the work will be done automatically.





















No comments:

Post a Comment