Separating digits in java
<p>My code prints the result of converting n into base B. I am using % in my code. If % of two numbers gives an output of for example "11", how to I separate the digits so my output looks like "1 1"</p>

<pre><code>        String s;
        int r;

        if(n &lt; b){
            return n + " ";
        }else{
            s = converting(n/b,b);
            r = (n % b);
        }
        return s + r;
    }

    public static void main(String[] args) {
        Scanner scnr = new Scanner (System.in);
        RecursionMethod num = new RecursionMethod();
        System.out.println("Enter Values: ");
        System.out.print("B: ");
        int first = scnr.nextInt();
        System.out.print("B: ");
        int second = scnr.nextInt();
        System.out.println("Result: " + num.converting(first,second));
        scnr.close();
    }
}
</code></pre>