Find Here !!!

Tuesday, 18 March 2014

Contoh Program C++ membuat bentuk Segitiga

Segitiga Angka

_____________________________________________________
#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
 int x,y,z;
 cout<<"input tinggi : ";cin>>x;
 cout<<"================\n";
 for(y=1;y<=x;y++)
 {  for(z=y;z<=x;z++)
{cout<<" ";}

for(z=1;z<=y;z++)
{cout<<" "<<y;}
cout<<endl;
 }
}
_________________________________________________________

 Semoga Bermanfaat ;)


1 comment: