Computer Science, asked by gadalaymonica, 7 months ago

Print the pattern program using loop in java .

1010101
10101
101
1​

Answers

Answered by LEGEND778
2

Answer:

i=3

j=0

while(i>1):

 a="10"*i+"1"+" "*j

 print a

 i=i-1

 j=j+2

 if(i<=1 and j>=4):

  break    

i=1

j=1

while(i<=1):

 a=" "*j+"10"*i+"1"+" "*j

 i=i-1

 j=j+2

Explanation:

Similar questions