Gaston7eze
2012-01-12 17:40:09
Well actually im trying to make the User to input the answer of this simple problem.
But,if the user input bad the answer it will ask again.I dont know what i am doing bad.
Code:
import java.util.Scanner;
import java.util.Scanner;
public class Guys {
public static void main(String []args){
Scanner Hello=new Scanner(System.in);
int SPrimerNum=50;
int SegundoNum=50;
long R;
System.out.println("How much is 50+50?");
R=Gaston.nextLong();
if (R=100){
System.out.println("You do it pretty well:)");
}else{
System.out.println("Incorrect");
}
}
}
}
}
It says me that it cannot convert from long to a boolean.
Help please.
But,if the user input bad the answer it will ask again.I dont know what i am doing bad.
Code:
import java.util.Scanner;
import java.util.Scanner;
public class Guys {
public static void main(String []args){
Scanner Hello=new Scanner(System.in);
int SPrimerNum=50;
int SegundoNum=50;
long R;
System.out.println("How much is 50+50?");
R=Gaston.nextLong();
if (R=100){
System.out.println("You do it pretty well:)");
}else{
System.out.println("Incorrect");
}
}
}
}
}
It says me that it cannot convert from long to a boolean.
Help please.