I don’t understand what I did wrong pls explain | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I don’t understand what I did wrong pls explain

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

9th Dec 2022, 9:42 AM
Ethan
Ethan - avatar
2 Answers
+ 1
What is temp there? You declared 'boil', but not using..
9th Dec 2022, 9:49 AM
Jayakrishna 🇮🇳
0
You declare boil ad ur input variable But using temp in the code There is no temp daclared To correct this code You have to change it tl temp instead of boil
10th Dec 2022, 6:06 PM
Jebreel Ziadna
Jebreel Ziadna - avatar