New Question!!!
Difficulty Level: Not easy, not hard, medium
WAP in JAVA to print the following pattern taking number of lines as input:-
0 0 0 0 0 0 0 0
1 0 0 0 1 1 5 7
2 0 0 1 0 3 3 6
3 0 0 1 1 5 1 5
_
• Quality Answers!!
Answers
Answered by
0
Answer:
20010336
I hope this is the answer...
Thanks
Regards
Teevra Aryan Das
Answered by
0
HERE IS UR ANSWER
STEP 1: START
STEP 2: SET lines=4
STEP 3: Initialize i and j
STEP 4: SET i =1
STEP 5: REPEAT
STEP 6 to 15 UNTIL i less than or equals to lineSTEP 6: SET j=1
STEP 7: REPET
STEP 8 and 9 UNTIL j is less than or equals to linesSTEP 8: IF i is equal to j PRINT * ELSE PRINT 0
STEP 9: SET j = j + 1
STEP 10: DECREMENT j by 1 and PRINT *
STEP 11: REPEAT
STEP 12 and 13 UNTIL j is greater than 0STEP 12: IF i is equals to j PRINT * ELSE PRINT 0STEP 13: SET j = j - 1
STEP 14: PRINT a new line
STEP 15: SET i = i + 1STEP 16: EXIT
Similar questions