Computer Science, asked by avinashmurmu99311, 10 months ago

WAP to input a number check and print whether the number is palindrome or not.Using java modular programming​

Answers

Answered by anshulsoni41
4

Answer:

this is the program

please mark as brainiest!!

Attachments:
Answered by nishanth69
1

Answer:

import java.util.*;

class Palindrome

{

   public static void main()

   {

       Scanner sc=new Scanner(System.in);

       System.out.println("enter a number");

       int num=sc.nextInt();

       int  reversedno = 0, remainder, originalno;

       originalno = num;

       

       while( num != 0 )

       {

           remainder = num % 10;

           reversedno = reversedno * 10 + remainder;

           num  /= 10;

       }

       

       if (originalno == reversedno)

           System.out.println(originalno + " is a palindrome.");

       else

           System.out.println(originalno + " is not a palindrome.");

   }

}

hope it helped

Explanation:

Similar questions