Find the largest N digit multiple of N | C ++ program to find largest multiple of N containing N digits ; Function to find the largest N digit multiple of N ; Driver code
#include <iostream> NEW_LINE #include <math.h> NEW_LINE using namespace std ; void smallestNumber ( int N ) { cout << N * floor ( ( pow ( 10 , N ) - 1 ) / N ) ; } int main ( ) { int N = 2 ; smallestNumber ( N ) ; return 0 ; }