Computer Science
Write a short program to print first n odd numbers in descending order.
Python
Python Control Flow
78 Likes
Answer
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
Answered By
35 Likes
Related Questions
Write a short program to check whether square root of a number is prime or not.
Write a short program to find average of list of numbers entered through keyboard.
Write a short program to print the following series :
(i) 1 4 7 10 ………. 40.
(ii) 1 -4 7 -10 ………. -40Write a short program to input a digit and print it in words.