#include <iostream.h>
#include <conio.h>
main()
{
int pil,i,j,m;
float a;
char k;
char l='A';
clrscr();
menu:
cout <<"----- TINGGAL PILIH ----- \n";
cout <<" 1. Deret 1 \n";
cout <<" 2. Deret 2 \n";
cout <<" 3. Exit \n";
#include <conio.h>
main()
{
int pil,i,j,m;
float a;
char k;
char l='A';
clrscr();
menu:
cout <<"----- TINGGAL PILIH ----- \n";
cout <<" 1. Deret 1 \n";
cout <<" 2. Deret 2 \n";
cout <<" 3. Exit \n";
cout <<" 4. properti arill
cout <<"------------------------------ \n";
cout <<"Pilihan anda : ";cin >>pil;
switch(pil) {
case 1:
for(i=5;i>=1;i-=1) {
k='A';
cout <<"\n";
for(j=1;j<=i;j+=1)
if(i%2==0)
cout <<k++<<" ";
else
cout <<j<<" ";
}
getch();
break;
case 2:
m = 11;
for(i=1;i<=5;i++) {
cout<<"\n";
for(j=1;j<=i;j++)
if(i<=4)
cout <<l++<<" ";
else
cout <<m++<<" ";
}
getch();
case 3:
break;
default:
cout <<"Pilihan hanya 1 atau 2 \n";
goto menu;
cout <<"------------------------------ \n";
cout <<"Pilihan anda : ";cin >>pil;
switch(pil) {
case 1:
for(i=5;i>=1;i-=1) {
k='A';
cout <<"\n";
for(j=1;j<=i;j+=1)
if(i%2==0)
cout <<k++<<" ";
else
cout <<j<<" ";
}
getch();
break;
case 2:
m = 11;
for(i=1;i<=5;i++) {
cout<<"\n";
for(j=1;j<=i;j++)
if(i<=4)
cout <<l++<<" ";
else
cout <<m++<<" ";
}
getch();
case 3:
break;
default:
cout <<"Pilihan hanya 1 atau 2 \n";
goto menu;
case 4:
cout>> "properti arill \n";
}return 0;
}
}return 0;
}
bisa dilihat outputnya di bawah :::
Tidak ada komentar:
Posting Komentar