 <p>This should return the third digit that of a number!</p> <pre><code>cout &lt;&lt; "Enter an integer"; int number; cin &gt;&gt; number; int n = number / 100 % 10 </code></pre> <p>Or (for all digits):</p> <pre><code> int number = 12345; int numSize = 5; for (int i=numSize-1; i&gt;=0; i--) { int y = pow(10, i); int z = number/y; int x2 = number / (y * 10); printf("%d-",z - x2*10 ); } </code></pre>