15/03/12

PROGRAM C++ MEMBUAT SEGITIGA BINTANG

#include <iostream.h>
#include <conio.h>
main ()
{
char bentuk;
int a;
cout << "  PROGRAM UNTUK MEMBUAT SEGITIGA DENGAN C++ " <<endl;
cout << " ========================================== " <<endl;
cout << "  " <<endl;
cout << "  " <<endl;
cout << "  " <<endl;
cout << "Masukan Banyaknya Inputan Character : ";
cin >> a;
cout << "Masukan Bentuk Character            : ";
cin >>bentuk;
cout << endl;
cout << endl;

for (int h=1;h<=a;h++)
{
for (int i=1;i<=h;i++)
{
cout <<bentuk;
}
cout <<endl;
}
for (int j=1;j<=a;j++)
{
for (int k=a;k>j;k--)
{
cout <<bentuk;
}
cout <<endl;
}
cout << endl;
cout << endl;
cout << " ============================================ " <<endl;
 cout << "  " <<endl;
 cout << "  " <<endl;
 cout << " *** TERIMAKASIH TELAH MENGGUNAKAN PROGRAM INI *** " <<endl;
 cout << " ***************** SELAMAT BELAJAR :) ************" <<endl;
getch ();
}

0 komentar

Posting Komentar