Monday, November 21, 2011

Program C++ Mencetak Bintang Segitiga

#include <iostream.h>
#include <conio.h>

void main()
{
int p;
cout<<"MEMBUAT SEGITIGA DENGAN *"<<endl<<endl;
cout<<"input jumlah X yang akan di buat = ";
cin>>p;
for (int n=p; n>=1; n--)
     {
   cout<<endl;
   for(int i=n-1;i>0; i--)
          {
      cout<<"*";
          }
     }
getch();
}


1 comments:

LoNKZ said...

works...

Post a Comment