Find the smallest number whose sum of digits is N | C # program to find the smallest number whose sum of digits is also N ; Function to find the smallest number whose sum of digits is also N ; Driver code
using System ; class GFG { static void smallestNumber ( int N ) { Console . WriteLine ( ( N % 9 + 1 ) * Math . Pow ( 10 , ( N / 9 ) ) - 1 ) ; } public static void Main ( ) { int N = 10 ; smallestNumber ( N ) ; } }