This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Saturday, March 27, 2010

For, While , & Do...While



CONTOHFOR:

#include
#include
#include
voidmain ()
{
int a;
for(a=1;a<=10;++a)
cout<
getch();
}





Project1:

#include
#include
#include
voidmain ()
{
int a;
for(a=10;a>=1;--a)
cout<
cout<<"\n";
getch();
}





PROJECT2:

#include
#include
#include
voidmain ()
{
int a;
for(a=1;a<=10;a=a+2)
cout<
cout<<"\n";
getch();
}





While:

#include
#include
#include
voidmain()
{
int bil=1;
while(bil <=10)
{
cout<<<"";
++bil;
}
cout<<"\n";
getch();
}




Whilegenap:

#include
#include
#include
voidmain()
{
int bil=2;
while(bil <=10)
{
cout<<<"";
bil=bil+2;
}
cout<<"\n";
getch();
}




DOWHILE:

#include
#include
#include
voidmain()
{
int bil=2;
do
{
cout<< bil<<"";
bil+2;
}
while(bil<=0);
getch();
}