Find Here !!!

Sunday, 23 March 2014

Program C++ menggunakan FOR membentuk Panah Kosong



_________________________________________________________

#include <iostream.h>
main ()

{
int a,b,c,x;
cout<<"Masukan Batas : ";
cin>>x;

for (a=1;a<=x;a++)
{
cout<<"*";

for(b=1;b<=a;b++)
{
cout<<" ";
}
cout<<"*";
cout<<endl;
}

for (a=1;a<=x;a++)
{
cout<<"*";
for(b=x;b>=a;b--)
{
cout<<" ";
}
cout<<"*";
cout<<endl;
}
}
___________________________________________________________
  Semoga Bermanfaat ;)

No comments:

Post a Comment