Computer Science, asked by rogerssteve, 1 year ago

how to find buzz no program

Answers

Answered by QGP
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");
        }
        
    }
    
}
Similar questions