F&A Diskussionen
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 Stimmen
8 AntwortenHeute heiß
[off-topic]Where is Result??
2 Votes
I really need a tutor
1 Votes
Mentor rank
2 Votes
∞♥
2 Votes
Cpp
1 Votes
Why does it disappear?
0 Votes
developpement
2 Votes