#How to get this output ?

8 messages · Page 1 of 1 (latest)

stable osprey
#
#include <stdio.h>

int main() {
    int n;
    printf("Enter the number of elements 'n':");
    scanf("%d",&n);


    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            int c=(i+j)%n;
            printf("%d ",c);
        }
        printf("\n");
    }

return 0;
}```
#

This is what i get as output

#

i need have those headers of table

wintry minnow
#

Insert additional prints at the appropriate place. Print the top row before the outer loop. Print the left column before the inner loop.

#

Is this Exercism related?

stable osprey
#

no

#

can i not get help outside those exercises ?

wintry minnow
#

This channel is meant for exercises. #programming is meant for non Exercism related discussions and would be the appropriate place