Panah Kanan & Kiri
__________________________________________________________
Panah Kanan
#include<iostream.h>
void main()
{
int x,y,z,v,w;
x=5;
for(y=1;y<=x;y++)
{for (z=y;z>=1;z--)
{cout<<" ";}
for (z=x;z>=1;z--)
{cout<<">";}
cout<<endl;}
for(w=x;w>=1;w--)
{for (v=1;v<=w;v++)
{cout<<" ";}
for (v=1;v<=x;v++)
{cout<<">";}
cout<<endl;
}
}
Panah kiri
#include <iostream.h>
main ()
{
int a,b,c;
for (a=1;a<=5;a++)
{
for(b=5;b>=a;b--)
{
cout<<" ";
}
for(c=1;c<=4;c++)
{
cout<<"*";
}
cout<<endl;
}
for (a=1;a<=5;a++)
{
for(b=1;b<=a;b++)
{
cout<<" ";
}
for(c=1;c<=4;c++)
{
cout<<"*";
}
cout<<endl;
}
}_______________________________________________________
Semoga Bermanfaat (y)
No comments:
Post a Comment