+ 10

Somebody plz help i want to take user input and then want to use it in if statement..

https://code.sololearn.com/cDcGQ1ra32w8/?ref=app

9th Jun 2017, 2:58 PM
Pulkit sharma
Pulkit sharma - avatar
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"); } } }
9th Jun 2017, 3:04 PM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar
+ 11
Thanks bro... šŸ‘sami khan
9th Jun 2017, 3:07 PM
Pulkit sharma
Pulkit sharma - avatar
+ 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"); }
9th Jun 2017, 3:06 PM
Tashi N
Tashi N - avatar
+ 10
Thanks@ Tashi N
9th Jun 2017, 3:08 PM
Pulkit sharma
Pulkit sharma - avatar
+ 10
@Tashi- I've checked all folders... And done the mail to sololearn.. Thanks for the suggestion
9th Jun 2017, 3:52 PM
Pulkit sharma
Pulkit sharma - avatar
+ 9
When i want to upvote a comment or like it's showing your account is not activated how to fix?
9th Jun 2017, 3:27 PM
Pulkit sharma
Pulkit sharma - avatar
+ 9
But i didn't receive any email
9th Jun 2017, 3:28 PM
Pulkit sharma
Pulkit sharma - avatar
+ 9
Check all folders (spam???). If you don't find the mail, contact SoloLearn: info@sololearn.com
9th Jun 2017, 3:44 PM
Tashi N
Tashi N - avatar
+ 8
You're welcome ^^
9th Jun 2017, 3:54 PM
Tashi N
Tashi N - avatar
+ 1
email might not be verified
9th Jun 2017, 3:28 PM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar