Monday 8 July 2013

C++ While Loop

#include<iostream.h>
#include<conio.h>
void main()
{
    clrscr() ;        //to clear output screen at the beginning
    int  i   ;        //decleration
    i = 1 ;        //initialization
    while( i < 5 )
    {
        cout<< i ;
        cout<<" The while loop" ;
        cout<<endl ;    
        i++ ;   
    }
    getch();
}

No comments:

Post a Comment