Nested Loops - Patterns

Please learn Nested Loop concepts before start solving this problems.


N = 5

*    *    *    *    *
*    *    *    *    *
*    *    *    *    *
*    *    *    *    *
*    *    *    *    *

N = 3

3    3    3
3    3    3
3    3    3 

N = 5

1    1    1    1    1
2    2    2    2    2
3    3    3    3    3
4    4    4    4    4
5    5    5    5    5

N = 5


N = 5


N = 5


N = 5


N = 5


N = 5


N = 4


N = 5


N = 5, Constraints: N will be always odd number and N > 1


N = 5


N = 5


N = 5


Last updated