Index of smallest triangular number with N digits | C # implementation of the above approach ; Function to return index of smallest triangular no n digits ; Driver code
using System ; class GFG { static double findIndex ( int n ) { double x = Math . Sqrt ( 2 * Math . Pow ( 10 , ( n - 1 ) ) ) ; return Math . Round ( x ) ; } public static void Main ( String [ ] args ) { int n = 3 ; Console . Write ( findIndex ( n ) ) ; } }