Computer Science, asked by shawrajveer06, 8 months ago

java program : write a program to enter any number and print whether it is a buzz number or not

Answers

Answered by hoangmustang
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