A number is said to be Buzz Number if it ends with 7 or is divisible by 7.
Example: 17 is a buzz number as it ends with 7,
14 is a buzz number as it is divisible by 7
77 as it ends with 7 and also divisible by 7
Program:
import java.util.*;
public class BuzzNumber
{
public static void main(String args[])
{
Scanner ob=new Scanner(System.in);
System.out.println(“Enter the number”);
int num=ob.nextInt();
if(num%10==7 || num%7==0)// 17 , 14 ,77
{
System.out.println(num+” is a Buzz Number”);
}
else
{
System.out.println(num+” is not a Buzz Number”);
}
}
}
Other important posts links ::
- What is noun? Short explanation
- Online Hindi tutor in Bangalore 8181969432
- Hindi Language Tutors for CBSE ICSE ISC & State Board | Free Demo Class
- Pronic number program in Java
- Loops in Java-while,for, do while
- Buzz number program in java
- Operators and Operands in Java C C++
- Important question for ICSE Board class 10th computer application exam