predict the output :
//function to reverse the digits of a number
public static int Reverse(int n)
{
int d;
r = 0;
while (n > 0) do
{
d = n%10;
r = r*10 + d;
n = n/10;
} }
return r;
Answers
Answered by
1
Answer:
d = 240
240>0
240%10
2
r = 20
240 = 240/10 = 24
later goes on
Answered by
1
Answer:
This code reverse the input number .
Explanation:
Example if input n is 123
then the output r will be 321
Mark as brainliest : )
Similar questions