CONTOHFOR:
#include
#include
#include
voidmain ()
{
int a;
for(a=1;a<=10;++a)
getch();
}
Project1:
#include
#include
#include
voidmain ()
{
int a;
for(a=10;a>=1;--a)
cout<<"\n";
getch();
}
PROJECT2:
#include
#include
#include
voidmain ()
{
int a;
for(a=1;a<=10;a=a+2)
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();
}