title: Java: Split an int into separate variables
body: <p>I need to split an int into separate variables.
  For instance x=356     a=3|| b=5 || c=6</p>
  
  <p>I have already solved it for 3 digit numbers only, but my program does not work for 2 digit or 4 digit numbers etc.</p>
  
  <p>P.S.
  I am a beginner.</p>