Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Ravi Shankar Ojha
- * https://www.facebook.com/groups/javaharikrishna/permalink/1164877420304483/?comment_id=1165276810264544
- */
- public class RaviShankarOjhaExample {
- public static void main(String[] args){
- int cnt=0;
- for(int y=7; y>=0;y--)
- {
- for(int x=(5-cnt); x>0; x--)
- {
- if(y%2==1 || y==0)
- {
- System.out.print(y*x+" ");
- }
- }
- if(y%2==1 || y==0){
- cnt++;
- }
- System.out.println();
- }
- }
- }
Add Comment
Please, Sign In to add comment