write a program to check whether the product of any two numbers is a buzz number or not
Answers
Answered by
9
choice = "Yes"
while choice == "Yes":
x = int(input("Enter a number: "))
y = int(input("Enter a second number: "))
p = x*y
print()
print(p, "is their product.")
print()
if p%7 == 0 or p%10 == 7:
print(p, "is a Buzz number.")
else:
print(p, "is not a Buzz number.")
print()
choice = input("Would you like to go again? [Yes/No]: ")
A Buzz number is any number that is either divisible by 7 or ends with 7.
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