Professional Documents
Culture Documents
Computer Science Project
Computer Science Project
Computer Science Project
PROJECT
THE LOOPS
The LOOPS (also called ITERATION STATEMENTS )
allow a set of instructions to be performed repeatedly
until a certain condition is fulfilled.
Parts of a loop
1.) Initialization expression - Before entering a loop, its
control variable must be initialized. The initialization
of the control variable take place under initialization
expression. The initialization expression give the loop
variable their first value. The initialization expression
is executed only once, in the beginning of the loop.
2.) Test expression - The text is an expression whose
truth value decides whether the Loop-body will be
executed or not. If the test expression evaluates to
be true i.e 1, the loop-body gets executed , otherwise
the loop is terminated.
SYNTAX :
{
do
statement;
} while (test-expression);
PROGRAM TO PRINT ALL THE UPPERCASE LETTERS
#include<iostream.h>
#include<conio.h>
Void main()
{ clrscr();
Char ch=A ;
Do
{
Cout<<\n<<ch;
Ch++;
}while (ch <= Z) ;
Getch();
}