title: How to remove the most significant digit of an int (e.g. from 547 to 47 to 7)?
body: <p>I have to write a program where I check if an int is a prime number. If it is, I have to cut the most significant digit and check if the new number is prime, again I cut the most significant digit and check again, until my number is 1 digit long.</p>
  
  <p>For example if I have 547, I check if it is prime. After I've verified that it is, I cut the 5 and check if 47 is prime, then I check if 7 is prime.</p>
  
  <p>The only part of the code I need is the one to cut the number.
  I'm sorry if I cannot include my code, but at the moment I have no idea how to do it. Could you suggest a solution both in an arithmetic way and by using a function? (if a function that can do that exists)</p>
  
  <p>By arithmetic I mean, just by using standard mathematical operations, I know for example how to cut the <em>least</em> significant digit:</p>
  
  <pre><code>num = num / 10;
  </code></pre>
  
  <p>So that 547 would become just 54 and so on.</p>