Program Menampilkan Bintang Bentuk Layang-Layang
Posted by Budi Arieyanto | Posted in Borlant C++ | Posted on 05.09
#include<iostream.h>
#include<conio.h>
void main()
{
for (int i=1; i<=10;i++)
for (int j=1; j<=5;j++)
{
if (i==1)
if (j==3)
cout<<" *";
else
cout <<" ";
if(i==2)
if (j==2)
cout<<" ***";
else
cout<<" ";
if(i==3)
if (j==1)
cout<<" *****";
if(i==4)
if (j==2)
cout<<"*******";
if(i==5)
if (j==1)
cout<<" *****";
if(i==6)
if (j==2)
cout<<" ***";
if(i==7)
if (j==2)
cout<<" *";
if(j==5)
cout <<endl;
}
getch();
}


Comments (0)
Posting Komentar