To print the pattern like
for n=4 1234 9101112 13141516 5678
for n=5 12345 1112131415 2122232425 1617181920 678910
for n=6 123456 131415161718 252627282930 313233343536 192021222324 789101112
I have made a program in C++ for generalisation of n which is total number of lines as well as total number of numbers in one line.