Thursday, September 17, 2015

Interesting Pattern with single for loop!

Minimum loop required to print below Pattern (can be n*n).

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

No comments:

Post a Comment