write a menu driven program to accept a number and check whether it is buzz number or not
Answers
Answered by
4
Answer:
A number is said to be Buzz Number if it ends with 7 OR is divisible by 7.
The task is to check whether the given number is buzz number or not.
Examples:
Input : 63
Output : Buzz Number
Explanation: 63 is divisible by 7, one
of the condition is satisfied.
Input : 72
Output : Not a Buzz Number
Explanation: 72 % 7 != 0, 72 is neither
divisible by 7 nor it ends with 7 so
it is not a Buzz Number.
Answered by
1
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