Advertisement
JeffGrigg

NiteshPatil

Apr 23rd, 2017
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.38 KB | None | 0 0
  1. public class NiteshPatil {
  2.     public static void main(String[] args) {
  3.         boolean reverse;
  4.         for(int i = 1; i <= 7; i++) {
  5.             reverse = false;
  6.             for(int j = 1; j != 0 ; j = (reverse ? --j : ++j)) {
  7.                 if(j == i) reverse = true;
  8.                 System.out.print(j);
  9.             }
  10.             System.out.println();
  11.         }
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement