What will be the output of the following program? for i in range(1,6): if i%4 == 0: print(‘x’) elif i%2 == 0: print(‘x’) else: print(‘xxxxx’)

Questions & AnswersCategory: PythonWhat will be the output of the following program? for i in range(1,6): if i%4 == 0: print(‘x’) elif i%2 == 0: print(‘x’) else: print(‘xxxxx’)
Geek Boy Staff asked 2 years ago

What will be the output of the following program?

for i in range(1,6):
    if i%4 == 0:
        print('x')
    elif i%2 == 0:
        print('x')
    else:
        print('xxxxx')

a.

xxxxx
x x
xxxxx
x x
xxxxx

b.

xxxxx
x
xxxxx
x
xxxxx