C Program To Count Digit k in Number n using Recursion
Satish B
https://technotip.com/8170/c-program-to-count-digit-k-in-number-n-using-recursion/
Lets write a C program to count the number of occurrences of digit k in user input positive integer number n, using recursion.
For Example: If user inputs n = 12235, and k = 2, then our C program should find how many times digit 2 is present in number 12235.
Note: (num % 10) fetches last digit in num. If num = 1234; (num%10) fetches the last digit from right, which is 4.
(num/10) removes the last number from right. If num = 1234; (num/10) removes last digit i.e., 4 and the result of (num/10) will be 123.
C Programming Interview / Viva Q&A List https://technotip.com/6378/c-programming-interview-viva-qa-list/
C Programming: Beginner To Advance To Expert https://technotip.com/6086/c-programming-beginner-to-advance-to-expert/ ... https://www.youtube.com/watch?v=sZhIRYXkquk
16016491 Bytes