I think this code work well..
If s is the guessed number by user for (a+b)?
so you need to guess the right number for "correct printed"...
this is my simply test code, and work fine..
public static void main(String args[]) {
int a=new Random().nextInt(5);
int b=new Random().nextInt(5);
int c=a+b;
int ans=5;
System.out.println(c);
if(c==ans){
System.out.println("your guessed = "+ans+" is correct" +" a="+a+" b="+b);
}else{
System.out.println("your guessed = "+ans+" is not correct"+" a="+a+" b="+b);
}
}