Smallest number whose square has N digits | C # program for above approach ; Function to return smallest number whose square has N digits ; Calculate N - th term of the series ; Driver code
using System ; class GFG { static int smallestNum ( int N ) { float x = ( float ) ( Math . Pow ( 10 , ( N - 1 ) / 2.0 ) ) ; return ( int ) ( Math . Ceiling ( x ) ) ; } public static void Main ( ) { int N = 4 ; Console . Write ( smallestNum ( N ) ) ; } }