Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class NiteshPatil {
- public static void main(String[] args) {
- boolean reverse;
- for(int i = 1; i <= 7; i++) {
- reverse = false;
- for(int j = 1; j != 0 ; j = (reverse ? --j : ++j)) {
- if(j == i) reverse = true;
- System.out.print(j);
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement