Using a last element as search element
int key = 40 ; int position = findElement ( arr , n , key ) ; if ( position == - 1 ) Console . WriteLine ( " Element ▁ not ▁ found " ) ; else Console . WriteLine ( " Element ▁ Found ▁ at ▁ Position : ▁ " + ( position + 1 ) ) ; } }