Find the smallest first, then find the smallest again, but this time with the condition that this new smallest must be larger than the previous smallest.
Ok, thanks, but this is too much compicated for me. I don't know what is float and so on, because I'm just beginner. It is possible to write this code without float and so on ->?
Nice code! One minor point.
I think the initial value for secondsmallest should be a very large number. If arr[0] is the smallest number in the array, then the value of secondsmallest will not change ever.