0

Why does this java code give me an Timeout Exception.

import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int temp = sc.nextInt(); sc.close(); int boiling = 100; if (temp > boiling) { System.out.println("Boiling"); } else { System.out.println("Not boiling"); } } }

11th Jul 2024, 5:51 PM
Masn
Masn - avatar
3 Answers
+ 1
on Sololearn it works fine, try it again
11th Jul 2024, 8:24 PM
zemiak
+ 1
The above code is working fine. You can try again
12th Jul 2024, 3:47 PM
Ayush Raj
0
I can' t learn because I don' t have any heart so what I do?
13th Jul 2024, 3:53 PM
Ekta
Ekta - avatar