Computer Science, asked by anushka422497, 10 months ago

write a menu driven program to accept a number and check whether it is buzz number or not

Answers

Answered by sudhanshu2554
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 Brenquoler
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