java program : write a program to enter any number and print whether it is a buzz number or not
Answers
Answered by
3
Answer:
CHECK MY SOLUTION:
package newPack;
import java.util.*;
public class isBUZZ {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int a = input.nextInt();
if(isBuzz(a))
System.out.println("Buzz number");
else
System.out.println("NOT BUZZ NUMBER");
}static boolean isBuzz(int num) {
return (num % 10 == 7 || num % 7 == 0); // checking if the number
// ends with 7 and is divisible by 7
}
}
Explanation:
BRAINLIEST
Similar questions
Social Sciences,
3 months ago
Economy,
3 months ago
English,
3 months ago
Business Studies,
8 months ago
English,
8 months ago
Hindi,
11 months ago