help with triangle

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
What do you mean by "set the coordinates".

I need that cursor down 5 lines and 3 to the right space bar and then draw a triangle
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
thank you very mach.
Topic archived. No new replies allowed.