FreePrograms


C language is a middle level language. It is a structured language. C language is a case sensitive language. All syntax written in c language is in lower case. C is the basis for C++.
  CONTACT US   ABOUT US   PRIVACY  DISCLAIMER

FREE C PROGRAMS 

What is C C vs C++ vs Java Program Structure Data Types in C Basic Rules of C & C++
Functions in C If, Else Conditions Loops in C Switch Case Arrays
Pointers Structures in C Strings in C Command Line Arguments Type Casting
Linked Lists Recursion Binary Trees Inheritance Multiple Inheritance
Templates File I/O Object Oriented Programming Data Structures in C C interview Questions




Loops in C language

For Loop -Most Useful Loops

for ( variable initialization; condition; variable inc/dec )

{
  Code to execute while the condition is true
}
While Loop - Simple Loops

while ( condition )

{

Code to be executed if the condition is true

}

Do While Loops - It is useful when we want to loop at least once

do

{
}

while ( condition );

Below is a simple c program which demonstrates the working of all three types of loops i.e for loop ,while loop and do while loop.

What is the difference between while loop and do while loop?

A while loop might never execute a statement if the expression is false but a do while will always execute the statement at least once.
 

COPYRIGHT 2009 ALL RIGHTS RESERVED FREECPROGRAMS.COM