July 5, 2021 in C and CPP
c) Write a ‘C’ function that returns the k-th digit from the right in the positive integer n. Forexample, digit(829,1) returns 9, digit(829,3) returns 8. If k is greater than the number ofdigits in n then the function is to return –1. Include appropriate documentation in yourprogram.