Question: Write an expression that prints Special number if specialNum is -99, 0, or 44. CHALLENGE ACTIVITY 3.7.2: Detect specific values. Write an expression that prints
Write an expression that prints "Special number" if specialNum is -99, 0, or 44.

CHALLENGE ACTIVITY 3.7.2: Detect specific values. Write an expression that prints "Special number" if specialNum is -99, 0, or 44. 1 test passed 4 5 All tests passed 1 import java.util.Scanner; 2 3 public class FindSpecialValue { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); 6 int specialNum; 7 8 specialNum = scnr.nextInt(); 9 10 if (specialNum == -99 && specialNum == o 11 specialNum == 44) { 11 System.out.println("Special number"); 12 13 else { 14 System.out.println("Not special number"); 15 } 16 } 17 | Run
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
