Here is my code below. If I enter 2 for "How many rows question" and 9 for "How many values to be used question... I get the following result...
Now, the code does what I want but I'm asking how many rows the user wants.
I want the user to be able to enter in how many columns he wants instead of how many rows rows (but I want the same result as before) how would I go about doing it?
int func_col(int, int);
int q, a, b, c, x, row, max_value;
printf("How many rows? ");
scanf(" %d", &row);
printf("How many values to be used? ");
scanf(" %d", & max_value);
q = func_col(max_value, row);
for(b=1, c=0; c<row; c++)
for(a=0; a<q+1; a++)
int func_col(int max_value, int row)
return(max_value / row);
return((max_value / row)+1);