c programming looping with rows and columns : I am trying to make a programme that gets `3 inputs` from the user. row/columns count and numbers range.

In my case and for example lets say `4 1 16` so it means `4 rows and columns` print `numbers from` `1-16`.

I have a problem accomplishing something.

    #include <stdio.h>
    #include <stdlib.h>
    
    
    int num1,num2,count,i,y;
    int main()
    {
        count = 4;
        num1 = 1;
        num2 = 16;
    
    for(i=1; i<=count; i++){
    
    
        for(y=1; y<=count; y++){
                printf("%d ",y);
            }
    
        printf("\n");
    }
    
        return 0;
    }

The output is

1 2 3 4

1 2 3 4

1 2 3 4

1 2 3 4

Whereas I want my output to be:

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16
