Outputnya
:
Listingnya
:
#include<iostream.h>
main()
{
int v,a,b,c;
cout<<"Masukkan
baris : ";
cin>>v;
cout<<endl;
cout<<"Masukkan
kolom : ";
cin>>c;
for(a=1;a<=c;a++)
{
for(b=1;b<=c;b++)
{
cout<<"*";
}
cout<<endl;
}
for(a=1;a<=v;a++)
{
for(b=1;b<=a;b++)
{
cout<<"*";
}
cout<<endl;
}
for (a=v;a>=0;a--)
{
for(b=a;b>=0;b--)
{
cout<<"*";
}
cout<<endl;
}
for(a=1;a<=c;a++)
{
for(b=1;b<=c;b++)
{
cout<<"*";
}
cout<<endl;
}
return(0);
}
0 komentar:
Posting Komentar