Move a character about a line ....
#include<iostream.h>
#include<math.h>
#include<conio.h>
int main()
{
clrscr();
int i,j,y,z;
cout<<"\n\n\n";
for (int x=-5;x <= 5;x++)
{
for ( i=-5;i <= x;i++)
{
if (i==x)
{
y=-1*x+1;
for(j=-5;j<=y;j++)
{
if(j==y)
cout<<"A";
else
cout<<" ";
}
}
}
cout << "\n";
getch();
}
return 0;
}
#include<math.h>
#include<conio.h>
int main()
{
clrscr();
int i,j,y,z;
cout<<"\n\n\n";
for (int x=-5;x <= 5;x++)
{
for ( i=-5;i <= x;i++)
{
if (i==x)
{
y=-1*x+1;
for(j=-5;j<=y;j++)
{
if(j==y)
cout<<"A";
else
cout<<" ";
}
}
}
cout << "\n";
getch();
}
return 0;
}
No comments:
Post a Comment