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 AnswersHot today
App Development
1 Votes
GUI-Based Python code in Webpage
3 Votes
Convert Animated SVG to PNG
1 Votes
My Missing Courses
1 Votes
cyber security
0 Votes
Are '\0' and NULL the same?
1 Votes
Number addition
0 Votes