Friday, June 5, 2020

Write a program in java to input a number and check whether it is Buzz Number or not?(n%10==7 ||n%7==0)

10)  Write a program in java to input a number and check whether it is Buzz Number or not?(n%10==7 ||n%7==0)

import java.util.*;
public class Buzz_number
{
    public static void main(String args[ ])
    {
        Scanner sc = new Scanner (System.in);
        System.out.println("Enter a numbers");
        int a = sc.nextInt();
        if(a%10==7||a%7==0)
        {
            System.out.println("Entered number is a buzz number ");
        }
        else
        {
             System.out.println("Entered number is not a buzz number ");
        }
    }
}

No comments:

Post a Comment

if you have any doubts, Please let me know.
Your Truly
Shashank Porwal

 jhvghvgk ;nkjn ,nkjhj