Q&A Discussions
Can someone explain this code to me....
class ReverseNumberDemo
{ public static void main(String args[]) {
int num=123456789;
int reversenum =0;
while( num != 0 ) {
reversenum = reversenum * 10;
reversenum = reversenum + num%10;
num = num/10; }
System.out.println("Reverse of specified number is: "+reversenum);
}
}
the thing I don't get is the reversenum part......isn't reversenum=0 so wouldn't reversenum*10=0
0 Votes
8 AnswersExeption Handling
2 Votes
17 AnswersHot today
Gimme some advice
1 Votes
Php?
0 Votes
how to create my own html page
0 Votes
React js
0 Votes
Data science
2 Votes
Hi how to make game
1 Votes
C language to make UI
0 Votes