KnowledgeBoat Logo

Computer Applications

Program to check whether the product of two numbers is a buzz number or not.
[A number that ends with 7 or is divisible by 7, is called a buzz number]

Java

Java Conditional Stmts

ICSE

69 Likes

Answer

public class KboatBuzzCheck
{
    public static void buzzNumCheck(int a, int b) {
        int p =  a * b;
        System.out.println("Product = " + p);
        if (p % 10 == 7 || p % 7 == 0)
            System.out.println("Product is a Buzz Number");
        else
            System.out.println("Product is not a Buzz Number");
    }
}

Output

BlueJ output of Program to check whether the product of two numbers is a buzz number or not. [A number that ends with 7 or is divisible by 7, is called a buzz number]

Answered By

28 Likes


Related Questions