Computer Science, asked by Anonymous, 10 months ago

write a program in java to accept a number from the user and check whether the number is a BUZZ number or not (buzz number is a number which is either divisible by 7 or the last digit is 7)

Answers

Answered by Brenquoler
2

import java. util. *

class Buzz

{

public static void main (string args[])

{

Scanner sc= new Scanner (System. in);

int x;

System.out.println ("Enter a number");

x=sc. nextInt ();

if(x%==0||x/10==7)

System.out.println (x+"is Buzz number");

else

System.out.println (x+"is not Buzz");

}

}

Similar questions