0

What's wrong with my code

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double passscore=3.5; double score = scanner.nextDouble(); // your code goes here if(score>passscore) { System .out.println("congratulation"); } else { System .out.println("sorry"); } } }

15th Jun 2021, 3:22 PM
Reva
3 Antworten
+ 2
Maybe there is an extra space in lines "System .out.println("...")" between "System" and "."?
15th Jun 2021, 7:12 PM
Anastasia Verbitskaya
0
It's working.. pls add the problem details for which you wrote the code.. edit: may be you need >= instead of >, I guess..
15th Jun 2021, 3:27 PM
Jayakrishna 🇮🇳
0
Reva You have put an extra space after each "System", so remove that, else your code is fine.
17th Jun 2021, 9:49 AM
DIPTIRANI SAHU