+ 1
Don't know what is wrong with line 6 and 8 ...pls I need help...
public class myProgram { public static void main(String[] args) { Scanner answer= new Scanner (System.in) String Q=("iam thinking of a number in my mind btw 1 to 10,can u guess d number"); //answer is 5 System.out.println(Q) int answer=answer.nextInt(); if(ansNum<5) { System.out.println("higher"); } else if(ansNum>5) { System.out.println("Lower"); } else if(ansNum==5) { System.out.println("you are very correct"); } else { system.out.println("that number is not between 1 to 10....your mistake"); } } }
3 Réponses
+ 5
int ansNum=answer.nextInt();
+ 2
You didn't put semicolon ";"
0
1 more error to be solved in line 9