write a program to input a number and print yes only if it is greater than 150 and divisible by 7 java correct answer dena else report
Answers
Answered by
1
Answer:
import java.util.Scanner;
class Program
{
public static void main(String[] args)
{
//Declaration
Scanner input = new Scanner(System.in);
int num;
//Prompt and accept a number from user
System.out.println("Enter a number: ");
num = input.nextInt();
//Display
if (num > 150 && num % 7 == 0)
{
System.out.println("Yes");
}
}
}
Similar questions