help with triangle

Feb 20, 2016 at 3:51pm
help me please
why can't I set the coordinates triangle???

my code


int a=1;
int top=5; //coordinate
int left=3; //coordinate
for(int i=0;i<top;i++)
{
cout<<endl;
}
for(int n=0;n<left;n++)
{
cout<<" ";
}

for(int i=0;i<5;i++) //triangle
{

for(int j=0;j<a;j++)
{
cout<<"*";
}
cout<<endl;
a++;
}
Last edited on Feb 20, 2016 at 3:52pm
Feb 20, 2016 at 4:06pm
What do you mean by "set the coordinates".

Feb 20, 2016 at 7:48pm
I need that cursor down 5 lines and 3 to the right space bar and then draw a triangle
Feb 20, 2016 at 9:26pm
To position the cursor you can use the SetConsoleCursorPosition if you use Windows.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686025%28v=vs.85%29.aspx
Feb 21, 2016 at 10:00pm
thank you very mach.
Topic archived. No new replies allowed.