Thursday, February 20, 2020

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;
 } 

Output: 


No comments:

Post a Comment

Write a program in python which determine determines that the number is prime or not. What is your favorite number?

Write a program in python which determine determines that the number is prime or not. What is your favorite number? Code   number = int(inpu...