Disini saya menggunakan Borland C++ 5.02 , program ini tidak sepenuhnya sempurna karena terdapat banyak sekali error dalam prosesnya.
Semoga bermanfaat.
#include iostream.h
#include conio.h
main()
{
int bil,i,j,bil1,bil2,k,a,bil3,b,bil5,bil4,bil6;
clrscr();
cout<<"| ================= |\n";
cout<<"| Program Angka 2 |\n";
cout<<"| ================= |\n";
cout<<"masukkan bilangan : ";cin>>bil;
cout<<"\n";
bil1 = bil-1;
bil2 = bil+1;
for (i=1;i<=bil1;)
{
if (i==1)
{
for (j=1;j<=bil;)
{
cout<
}
}
else if (i>=2)
{
for (k=1;k<=bil1;)
{
cout<<" ";
k++;
}
cout<
}
i++;
cout<<"\n";
}
bil3 = bil+8;
bil5 = bil+9;
for (a=1;a<=bil1;)
{
if (a==1)
{
for (b=1;b<=bil;)
{
cout<
b++;
}
}
else if (a>=2)
{
cout<
}
cout<<"\n";
a++;
}
bil6 = bil+12;
for (b=1;b<=bil;)
{
cout<
b++;
}
getch();
return 0;
}
-
-
0
komentar
Posting Komentar