Write a function int digit (int num, int k) that return kth digit of the positive number num. For example, if num is the integer 12435, then the call digit (num, 0) would returns the digit 5, and the call digit (num, 2) would returns the digit 4. Note that digits are numbered from right to left. (0,1,2,3,4…)

Sounds like this is something you should do yourself. If you have code and you are having problems with it then post the code you have and what problem you are having. If it is a compilation error included the error from the compiler and what line it is referring to.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.