Find M | C ++ program to Find m - th number whose sum of digits of a number until sum becomes single digit is N ; Function to find the M - th number whosesum till one digit is N ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int findNumber ( int n , int m ) { int num = ( m - 1 ) * 9 + n ; return num ; } int main ( ) { int n = 2 , m = 5 ; cout << findNumber ( n , m ) ; return 0 ; }