Kamis, 27 September 2012

program piramid

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    int f,u,a,d;

cout<<"Masukkan nilai Segitiga :";
cin>>d;
cout<<endl;

for (f=d;f>=0;f--)
{
for(u=f;u>=0;u--)
{
cout<<" ";
}

for(a=0;a<=d-f;a++)
{
cout<<"*";
}
for(a=0;a<d-f;a++)
{
cout<<"*";
}
cout<<endl;
}


    system("pause");
    return 0;
}

Tidak ada komentar:

Posting Komentar