Computer Science, asked by tauahif8680, 11 months ago

Write a program to check whether the product of two numbers is a buzz number or not

Answers

Answered by mersalkeerthi46
14

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 Anonymous
31

import java.util.*;

class buzz_number

{

   public static void main(String args[])

   {

       Scanner sc=new Scanner(System.in);

       System.out.println("Enter numbers to check to check whether it is buzz number or not");

       int a=sc.nextInt();

       int b=sc.nextInt();

       int n=a*b;

       int d=n%10;

       if(n%7==0||d==7)

       {

           System.out.println(n+" is a buzz number");

       }

       else

       {

           System.out.println(n+" is not a buzz number");

       }

   }

}

Similar questions