CBSE Class 11 Computer Science Question 132 of 161

Flow of Control — Question 9

Back to all questions
9
Question

Question 9

Write a short program to print first n odd numbers in descending order.

Solution
n = int(input("Enter n: "))
x = n * 2 - 1

for i in range(x, 0, -2) :
    print(i)
Output
Enter n: 5
9
7
5
3
1
Answer