Question__3

PHOTO EMBED

Wed Apr 05 2023 14:38:22 GMT+0000 (Coordinated Universal Time)

Saved by @Mohamedshariif #java

import java.util.Scanner;
public class BooleanExpression2 {
    

    public static void main(String[] args) {
        
/*Question 3.
    Write a program that prompts the user to enter an integer. 
    If the number is a multiple of 5, the program displays HiFive. 
    If the number is divisible by 2, it displays HiEven.
*/
    Scanner scanner = new Scanner(System.in);
    System.out.println("Please Enter a number:");
    int number = scanner.nextInt();
    if(number % 2 == 0)
    {
        System.out.println("Hi Even ");
    }
    else if( number % 5 == 0)
    {
        System.out.println("Hi Five: ");
    }
    }
}
content_copyCOPY