- In while loops must have its initial value
- must exist as long as it met to definisi
#include<iostream.h>
#include<conio.h>
int main ()
{
int i;
while (i<=10)
{
cout<<i;
if ((i%2)==0)
cout<<"genap"<<endl;
else
cout<<"ganjil"<<endl;
i++;
}
getch();
return 0;
}
Leave reply