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");
        }
    }
}

No comments:

Post a Comment

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

 jhvghvgk ;nkjn ,nkjhj