We can reverse the number and check if they are equal.

Output

Discussion

Above program is just show of logic and for generic program you need to change few things.

Compiled with JDK 9

Categories: Java

faltutech

Pursuing MCA from YMCA University, Faridabad

Leave a Reply

Your email address will not be published. Required fields are marked *

Read previous post:
Reverse a Number Using While and For Loop In Java
Reverse a Number Using While and For Loop In Java

[crayon-5a2bbac0b7f2f487898575/] Output 5984984 Discussion For 'for' loop use - for(;num!=0;) Compiled with JDK 9

Close