Find Nth positive number whose digital root is X | C ++ program to find the N - th number with digital root as X ; Function to find the N - th number with digital root as X ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int findAnswer ( int X , int N ) { return ( N - 1 ) * 9 + X ; } int main ( ) { int X = 7 , N = 43 ; cout << findAnswer ( X , N ) ; return 0 ; }