Hello guys, I have created a program that will accept left and top (x,y) it will determine where the cursor will start printing "*". My problem is if i input 2 in the left variable it will print the 1st column starting with the left or X coordinate. The next row however wont start just below the 1st * of the 1st column. I need to put the inside the for loop and increment the top so that it will start just below the previous column.
Code:
#include <conio.h>
#include <iostream.h>
#include <stdio.h>
int main()
{
int mat[10][10],left,top,row,col;
clrscr();
cout<<"\nEnter value for left: ";
cin>>left;
cout<<"\nEnter value for top: ";
cin>>top;
cout<<"\nEnter value for Row: ";
cin>>row;
cout<<"\nEnter value for Colun: ";
cin>>col;
clrscr();
gotoxy(left,top);
for(int i= 0; i < row; ++i)
{
for(int j = 0; j< col ; ++j)
{
printf("* ",mat[row][col]);
}
printf("\n");
}
getch();
return 0;
}