Q&A Discussions
Class competition
0 Votes
4 AnswersCan 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 AnswersHot today
Domain name
7 Votes
After the break
2 Votes
Why is the model not loading?
0 Votes
Make suggestions!!
1 Votes
C++ question
1 Votes
How to make a game
0 Votes
Question on 50- win badge
0 Votes