Hi guys,
I need some help with a while loop in the context of my system
...
Code:
int row = 0;
int column =0;
for (i = 0; i < m; i++)
{
for (j = 0; j < inputs[i]; j++)
{
printf("\nRow: %d\n", row);
printf("\tGate: %d, Input Element: [%d][%d]: ", position, row, column);
scanf("%d", &matrix[row][column]);
row++;
}
position++;
}
column++;
...
The system populates the the first Row with the values the user has specified, it starts at [0][0] and the depending on how many input values, will continue to increment down the row, ie;
[0][0]
[1][0]
[2][0].
This is where I am stuck, once it has finished with the that particular row, I want the system to ask the user if they wnt to increment the column numbr and start the whole process again. Populating the thr row elements with values for the new column, i,e;
[0][1]
[1][1]
[2][1].
I hope this makes sense, I know the code is weakly coded, but that is not my concern, it is to get the column to increment while resetting the Row increementer back to 0 for eah time the column ++.
Thank you all in advance,
Archie