Dyskusje Q&A
% (помогите разобраться)
0 głosów
1 OdpowiedźAddition of two numbers
-5 głosów
9 odpowiedziCan 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 głosów
8 odpowiedziPopularne dzisiaj
Ai generated practices
3 Votes
Solving coding challenges
2 Votes
Advertising in Sololearn
1 Votes
I am new
1 Votes
RUST'S FUTURE
1 Votes
Programming Language
0 Votes