New course! Every coder should learn Generative AI!
Try a free lessonQ&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
What’s wrong with this???
6 Votes
What's wrong with these codes?
1 Votes
What can i do with bits
4 Votes
Guys, it’s about streak
1 Votes
Arrays
0 Votes
I don't get it
0 Votes
Chess Tournament Python code
1 Votes
Wrong HTML Code check
0 Votes
Html
0 Votes