2) To input a number and check whether a number is buzz number or
buzz if it is ends with 7 or divisible by 7)
Answers
Answered by
8
Answer:
This is done in JAVA
import java.util.*;
class Buzz
{
public static void main (String ar[])
{
Scanner sc=new Scanner (System.in);
int n=sc.nextInt();
if ((n%10==7)ll(n%7==0))
System.out.println("Buzz");
else
System.out.println("Not Buzz");
}
}
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