an example of buzz number program blue j
Answers
Answered by
4
A buzz number is one which is either divisible by 7 or ends with 7.
PROGRAM:-
import java.io.*;
class buzz
{
public static void main()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a number of your choice:-");
int n=Integer.parseInt(br.readLine());
int r,d
if(n%7==0)
{
System.out.println("This is a BUZZ number.");
}
r=n%10;
if(r==7)
{
System.out.println("This is a BUZZ number.");
}
else
{
System.out.println("This is NOT a BUZZ number.");
}
}
}
PROGRAM:-
import java.io.*;
class buzz
{
public static void main()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a number of your choice:-");
int n=Integer.parseInt(br.readLine());
int r,d
if(n%7==0)
{
System.out.println("This is a BUZZ number.");
}
r=n%10;
if(r==7)
{
System.out.println("This is a BUZZ number.");
}
else
{
System.out.println("This is NOT a BUZZ number.");
}
}
}
Answered by
2
import java.util.*;
class buzz_number
{
public void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter a number to check to check whether it is buzz number or not");
int n=sc.nextInt();
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
Physics,
8 months ago
India Languages,
8 months ago
Math,
1 year ago
Math,
1 year ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago