Thursday, 15 December 2011

if - continue


#include<conio.h>
#include<iostream.h>
void main()
{
clrscr();
int a,bil;
char lagi;
cout<<"\n\n                    PROGRAM MENGHILANGKAN BILANGAN"<<endl;
cout<<"                   MENGGUNAKAN FOR, IF DAN CONTINUE"<<endl;
cout<<"           ++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
awal:
cout<<"\n\n               MASUKKAN ANGKA YANG AKAN DIHILANGKAN [1-18]= ";
cin>>a;
cout<<",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"<<endl;
for(bil=1; bil<=18;++bil)
{
if(bil==a)
continue;
cout<<" ["<<bil<<"]";
}
cout<<"\n================================================================================"<<endl;
cout<<"\n\n     Apakah anda Anda ingin mengulang lagi dengan angka yang lain..???"<<endl;
cout<<"     Jawab  [Y/T] = ";
cin>>lagi;
if (lagi=='y'|| lagi=='Y')
{
cout<<"\n/////////////////////////////////////*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"<<endl;
goto awal;
}
else
cout<<"\n\n\n     TERIMA KASIH TELAH MENGGUNAKAN PROGRAM SAYA.."<<endl;
cout<<"     OLEH  : JAYARI (10 54 0040)"<<endl;
cout<<"\n\n\n\n                                            << PRESS ANYKEY TO EXIT...!!!>>";

getch();
}

No comments:

Post a Comment