Given a number n, print the nth odd number. The 1st odd number is 1, 2nd is 3 and so on.
Input : 3 Output : 5 First three odd numbers are 1, 3, 5, .. Input : 5 Output : 9 First 5 odd numbers are 1, 3, 5, 7, 9, ..
The nth odd number is given by the formula 2*n-1.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Program to find Nth odd Fibonacci Number
- Nth number made up of odd digits only
- Count of integers in a range which have even number of odd digits and odd number of even digits
- Average of odd numbers till a given odd number
- Split the array into odd number of segments of odd lengths
- Check if a number has an odd count of odd divisors and even count of even divisors
- Program to find last two digits of Nth Fibonacci number
- Program to find the nth Kynea number
- Program to find the Nth Harmonic Number
- Program to find the Nth number of the series 2, 10, 24, 44, 70.....
- Program to delete Nth digit of a Number
- Program to find the Nth Prime Number
- Program for nth Fuss–Catalan Number
- Program for nth Catalan Number
- Print odd positioned nodes of odd levels in level order of the given binary tree
- Count numbers from given range having odd digits at odd places and even digits at even places
- Program to calculate the number of odd days in given number of years
- Number of digits in the nth number made of given four digits
- Find Nth number in a sequence which is not a multiple of a given number
- Program to print the sum of the given nth term
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.