Showing posts with label beast number. Show all posts
Showing posts with label beast number. Show all posts

Sunday, June 21, 2020

Write a program to input a number and check whether it is Beast Number or not? (a number contain 666 in the last)

21)  Write a program to input a number and check whether it is Beast Number or not? (a   number contain 666 in the last)

import java.util.*;
public class Beast_number_5
{
   public static void main(String args[ ])
    {
        Scanner sc = new Scanner (System.in);
        System.out.println("Enter a number");
        int a = sc.nextInt();
        int m = a%1000;
        if(m==666)
        {
            System.out.println("Entered number is a BEAST number");
        }
        else
        {
            System.out.println("Entered number is not a BEAST number");
        }
    }
}

 jhvghvgk ;nkjn ,nkjhj