write a program in java to accept a no. and check whether the no. is pallindrome or not.
Answers
Answered by
0
ᴘᴜʙʟɪᴄ ᴄʟᴀss ᴘᴀʟɪɴᴅʀᴏᴍᴇ {ɪɴᴛ ɴᴜᴍ = 121, ʀᴇᴠᴇʀsᴇᴅɪɴᴛᴇɢᴇʀ = 0, ʀᴇᴍᴀɪɴᴅᴇʀ, ᴏʀɪɢɪɴᴀʟɪɴᴛᴇɢᴇʀ;ᴏʀɪɢɪɴᴀʟɪɴᴛᴇɢᴇʀ = ɴᴜᴍ;// ʀᴇᴠᴇʀsᴇᴅ ɪɴᴛᴇɢᴇʀ ɪs sᴛᴏʀᴇᴅ ɪɴ ᴠᴀʀɪᴀʙʟᴇ.ᴡʜɪʟᴇ( ɴᴜᴍ != 0 ){ʀᴇᴍᴀɪɴᴅᴇʀ = ɴᴜᴍ % 10;ʀᴇᴠᴇʀsᴇᴅɪɴᴛᴇɢᴇʀ = ʀᴇᴠᴇʀsᴇᴅɪɴᴛᴇɢᴇʀ * 10 + ʀᴇᴍᴀɪɴᴅᴇʀ;
Similar questions
Chemistry,
5 months ago
Science,
5 months ago
Social Sciences,
5 months ago
Chemistry,
11 months ago
English,
1 year ago
English,
1 year ago
Social Sciences,
1 year ago