Wlcome to the blogging tifani

Program C++ Membuat piramid dengan Tinggi yang di Inputkan

Jumat, 24 Oktober 20140 komentar

#include<iostream.h>
#include<conio.h>
int main()
{
int x,y,j,i,bintang,spasi,pilih;
loop1:
cout<<"*sub menu."<<endl;
cout<<"\t\t==>>>MEMBUAT PIRAMID<<<== "<<endl;
cout<<"\t\t__________________________"<<endl;
cout<<"Input tinggi Piramid : ";
cin>>x;
y=x;
//clrscr();
cout<<"hasil piramid dengan jumlah bintang :"<<x<<endl<<endl;
for(i=0;i<x;i++)
{
for (spasi =0;spasi<y+10; spasi++)
{
cout<<" ";
}
for(j=0;j<=i;j++)
{
cout<<" *";
}
cout<<endl;
y--;
}
cout<<endl<<endl;
cout<<"\t\t\t._________________________________."<<endl;
cout<<"\t\t\t| kembali ke menu?  |"<<endl;
cout<<"\t\t\t| ya=1 tidak=0  |"<<endl;
cout<<"\t\t\t|_________________________________|"<<endl;

cin>>pilih;
system ("cls");
if (pilih==1){
goto loop1;}
else
cout<<"TERIMAKASIH";
getch();
}


Share this article :

Posting Komentar

 
Support : Cara Gampang | Creating Website | Johny Template | Mas Templatea | Pusat Promosi
Copyright © 2015. TIfanie - All Rights Reserved
Template edited by Creating Website Modify by Teknologi Informasi kinie
Proudly powered by Blogger