how to find buzz no program
Answers
Answered by
3
import java.util.Scanner;
public class Buzz
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("A Buzz Number is a number which ends in 7 or which is divisible by 7");
System.out.print("\nEnter a number: ");
int n = sc.nextInt();
System.out.println();
if((n%10 == 7)||(n%7 ==0))
{
System.out.println(n+" is a Buzz Number");
}
else
{
System.out.println(n+" is not a Buzz Number");
}
}
}
public class Buzz
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("A Buzz Number is a number which ends in 7 or which is divisible by 7");
System.out.print("\nEnter a number: ");
int n = sc.nextInt();
System.out.println();
if((n%10 == 7)||(n%7 ==0))
{
System.out.println(n+" is a Buzz Number");
}
else
{
System.out.println(n+" is not a Buzz Number");
}
}
}
Similar questions