Thursday, 15 December 2011

tampil bilangan genap


#include<stdio.h>
#include<conio.h>
#include<iostream.h>
void main()
{
int bil=2;
int a;
clrscr();
cout<<"  \n\nMENAMPILKAN BILANGAN GENAP \n\n";
cout<<"Masukkan Batas = ";cin>>a;
while (bil<=a)
{
if (bil % 2==0)
cout<<bil<<" - ";
bil++;
}
getch();
}

No comments:

Post a Comment