Remember, you have to do it in reverse:
public static void Long(long n)
{
if (n / 10 != 0)
{
reverse(n/10);
}
System.out.println(n%10);
}
Type: Posts; User: helloworld922
Remember, you have to do it in reverse:
public static void Long(long n)
{
if (n / 10 != 0)
{
reverse(n/10);
}
System.out.println(n%10);
}
Here's some tips that hopefully should help you figure it out:
Recursion is just breaking up a big problem into smaller pieces. What pieces can you break the problem up into (hint, see copeg's...