51 Java Reverse of Number Method 2 |

preview_player
Показать описание
"Learn How To Design + Code A Complete App From Scratch To Playstore"
-~-~~-~~~-~~-~-

This Java Tutorial Video shows a simple Java program to reverse a number using while loop and modulus operator
Join us on Facebook at
Follow us on Twitter at
Рекомендации по теме
Комментарии
Автор

Very precise explanation and helped me a lot, Thank you very much.

ramyar
Автор

NICE, Didn't know it was that easy

MegaBADASS
Автор

public class Test {

public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new
System.out.println("Enter a number: ");
int a =
int sum = 0, rem = 0;
while(a > 0){
rem = a%10;
sum = sum + rem;
sum *= 10;
a /= 10;
}
System.out.println(sum);
}

muddassirzafar
Автор

one problem is there, when i am putting value like 0123, 056531...then it not giving correct reverse value, 0 has been then output will be only 321, , , , 0 completely hide

prasantkumar
welcome to shbcf.ru