Tanpa basa-basi saya langsung saja, isi source code nya adalah :
oh ya...ini menggunakan program BORLAND C++ 5.02- #include <iostream.h>
- #include <conio.h>
- main()
- {
- int x,y,z,n;
- cout<<"==============================="<<'\n';
- cout<<" Masukkan jumlah baris: ";cin>>n;
- cout<<"==============================="<<'\n';
- cout<<"HASIL"<<'\n';
- for(x =1;x<=n;x++)
- {
- for(z=n;z>=x;z--)
- {cout<<" ";}
- for(z=x;z<(2*x);z++)
- {y=z%10;
- cout<<y;}
- for(z=2*(x-1);z>=x;z--)
- {y=z%10;
- cout<<y;}
- cout<<'\n';
- }
- getch();
- }
jika di run hasilnya :
Advertisement
EmoticonEmoticon