Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   Programming General (http://siteownersforums.com/forumdisplay.php?f=44)
-   -   How to reverse an integer in Java? (http://siteownersforums.com/showthread.php?t=199837)

sonakshibhathi 08-01-2017 03:00 AM

How to reverse an integer in Java?
 
Hi friends,
How to reverse an integer in Java?
please suggest to know..

jackkodell12 08-02-2017 04:53 AM

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. (

adityadev 03-18-2019 03:38 AM

Java program to reverse a number. import java.util.Scanner; class ReverseNumber. { public static void main(String args[]) { int n, reverse = 0; System. out. println("Enter an integer to reverse"); Scanner in = new Scanner(System. in);


All times are GMT -7. The time now is 03:43 AM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.