please correct me if I am wrong anywhere.
package en.codegym.task.pro.task04.task0410;
import java.util.Scanner;
/*
Second smallest number entered
*/
public class Solution {
public static void main(String[] args) {
//write your code here
int min = Integer.MAX_VALUE;
int min2 = Integer.MAX_VALUE;
int c = 0;
Scanner o = new Scanner(System.in);
while (o.hasNextInt())
{
int a = o.nextInt();
if (a < min) min = a;
if ((a > min)&&(a <= min2)) min2 = a;
c++;
}
if (c < 2) System.out.println("error");
else
System.out.println(min2);
}
}