How to reverse an integer in Java?

Author Topic: How to reverse an integer in Java?  (Read 1204 times)

Offline sonakshibhathiTopic starter

  • Trade Count: (0)
  • Semi-Newbie
  • *
  • Thank You 0
  • Posts: 10
  • Karma: 0
  • Gender: Female
    • Best Dental Implant Clinic in Jaipur
How to reverse an integer in Java?
« on: 08-01-2017, 03:53:42 »
Hi friends,
I would like to know,
How to reverse an integer in Java?


Offline traveloweb

  • Trade Count: (0)
  • Newbie
  • *
  • Thank You 0
  • Posts: 7
  • Karma: 0
Re: How to reverse an integer in Java?
« Reply #1 on: 01-11-2018, 03:32:53 »
Modding (%) the input int by 10 will extract off the rightmost digit. example: (1234 % 10) = 4.
Multiplying an integer by 10 will "push it left" exposing a zero to the right of that number, example: (5 * 10) = 50.
Dividing an integer by 10 will remove the rightmost digit. (

 

Related Topics

  Subject / Started by Replies Last post
19 Replies
7919 Views
Last post 07-08-2015, 04:18:14
by Sunainapaul11
37 Replies
7539 Views
Last post 04-29-2016, 01:00:10
by MaryGreen
20 Replies
6283 Views
Last post 06-18-2014, 05:46:37
by jayanta1
12 Replies
4715 Views
Last post 02-29-2016, 03:42:28
by fix.97
3 Replies
4490 Views
Last post 08-19-2015, 01:48:54
by SanviMalhotra