Computer Science, asked by khushi459, 1 year ago

write a program in java for a given number is adam no. or not

Answers

Answered by Lalithsirvi28
0
In order to run other peoples' Java programs, you must have the JRE (Java Runtime Environment). In order to write and run your own Java programs, you must have the JDK (Java Development Kit), which is sometimes called the SDK (System Development Kit)--these are the same thing. The JDK includes the JRE, so don't get both.

Answered by Puneeth1235
3

Answer:

import java.util.Scanner;

class Adam Num ber

{

   private static int reverse(int x)

   {  

       int tmp=x,rev=0;

       while(tmp!=0)  

      {          

           int dig=tmp%10;  

           rev=rev*10+dig;

           tmp/=10;

       }

       return rev;

   }

   public static void main(String args[])

   {

      Scanner in = new Scanner(System.in);

       int num,rev,sqNum,sqRev;

       System.out.print("Enter a Number : ");

       num = in.nextInt();

       rev=reverse(num);

       sqNum=num*num;

Explanation:

Similar questions