There should be atleast two elements
if ( n < 2 ) { Console . Write ( " Invalid ▁ Input " ) ; return ; } int firstSmallest = Int32 . MaxValue ; int secondSmallest = Int32 . MaxValue ; for ( int i = 0 ; i < n ; i ++ ) {