Monday, March 28, 2011


FOP CHAPTER 6
TOPIC : LOOP&WHILE


LOOP
#include<iostream.h>
main( )
{
//declare variable
//get input
cout<<"enter integer";
cin>>x;
//loop for
for(y=0:y<xy:y++)
{
cout<<"     "x;
}

WHILE
#include<iostream.h>
main( )
int x,y;
cout<<"enter an integer";
cin>>x;
//while(y<x)
cout<<"   "<<x;
y++;
}
}

No comments:

Post a Comment