write a program to print first n odd numbers in descending order.
please note that this question is from python
Answers
Answered by
33
Hey there!
You can code this program in many ways but i am providing you a very simple and easy way to understand the program and execute it with yourself. Take a look on it. :)
Here's your code.
# Python program to print first N odd numbers in descending order
# Author : Mahnaz @NamkeenCandy
n = int(input("Please enter any natural number :"))
for i in range (n -1, -1, -1):
a = 1 + i * 2
print("Descending order series :", a )
______________________________
See the attachment for proper review.
______________________________
Attachments:
Answered by
19
a=int(input("Enter a number:"))
print ("First",a,"odd numbers in descending order are:")
for i in range(1,a+1):
print((2*a)-1)
a=a-1
Similar questions
Science,
7 months ago
Computer Science,
7 months ago
Environmental Sciences,
1 year ago
Science,
1 year ago
Physics,
1 year ago
Math,
1 year ago