the pattern to be printed for (n=7) is:-
1
2 1 1 2
3 2 1 1 2 3
4 3 2 1 1 2 3 4
3 2 1 1 2 3
2 1 1 2
1
the pattern to be printed for (n=7) is:-
1
2 1 1 2
3 2 1 1 2 3
4 3 2 1 1 2 3 4
3 2 1 1 2 3
2 1 1 2
1
Hardcode for n = 1. Your program is giving incorrect answer.