Example. 123456, and we want the third from the right (\'4\') out.
The idea in practise is to access each digit seperately (ie. 6 5 4 3 2 1).
C/C++/C# preferred.
int returndigit(int n,int d) { d=d-1; while(d--) { n/=10; } return (n%10); }