Computer Science, asked by mohannavakoti41, 4 months ago

a.
11. Consider the following loop:
(1)
j=10
while j>=5:
print(“X”)
j=j-1
Which of the following for loop will generate the same output as the loop shown previously?
for j in range(-1,-5,-1):
print(“X”)
b. for j in range(0,5):
print(“X”)
c. for j in range(10,-1,-2):
print(“X”)
d. for j in range(10,5,-1):
print(“X”)​

Answers

Answered by harneetmakkad27
1

Answer:

I think the output of the first syntax will be '5'

according to this,

option ( b. for j in range(0,5):

print(“X”) )

is the right answer.

hope it helped.

Similar questions