+ 10
Somebody plz help i want to take user input and then want to use it in if statement..
10 Answers
+ 4
here x is a reference variable of the Scanner class you cannot compare it with an integer..
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
int x;
Scanner sc = new Scanner(System.in);
x= sc.nextInt();
if(x < 10) {
System.out.println("Hi,you are in if block");
}else{
System.out.println("you are in else block");
}
}
}
+ 11
Thanks bro... šsami khan
+ 10
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
if(x < 10) {
System.out.println("Hi, you are in
if block");
}else{
System.out.println("you are in else
block");
}
+ 10
Thanks@ Tashi N
+ 10
@Tashi- I've checked all folders... And done the mail to sololearn.. Thanks for the suggestion
+ 9
When i want to upvote a comment or like it's showing your account is not activated how to fix?
+ 9
But i didn't receive any email
+ 9
Check all folders (spam???). If you don't find the mail, contact SoloLearn: info@sololearn.com
+ 8
You're welcome ^^
+ 1
email might not be verified