Program for n | CPP program to find the nth odd number ; Function to find the nth odd number ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int nthOdd ( int n ) { return ( 2 * n - 1 ) ; } int main ( ) { int n = 10 ; cout << nthOdd ( n ) ; return 0 ; }