Java Program on Buzz Number
- Categories Java
A number is said to be Buzz Number if it ends with 7 OR is divisible by 7. The task is to check whether the given number is buzz number or not.
import java.util.Scanner; public class BuzzNumber { public static void main(String args[]) { int i , num; System.out.println("Enter number:"); Scanner sc= new Scanner(System.in); num= sc.nextInt(); if(num % 10 == 7 || num % 7 == 0) System.out.println("Buzz Number"); else System.out.println("Not a Buzz Number"); } }
You may also like
Single Linked List Programs in Java
28 August, 2021
Implementing Stack using Array in Java
28 August, 2021
Constructor Programs
3 July, 2021