12.11 LAB: Count the digits Write a recursive function called DigitCount() that takes a positive integer as a parameter
Posted: Sun Jul 10, 2022 11:26 am
12.11 LAB: Count the digits Write a recursive function called DigitCount() that takes a positive integer as a parameter and returns the number of digits in the integer. Hint: The number of digits increases by 1 whenever the input number is divided by 10. Ex: If the input is: 345 the function DigitCount() returns and the program outputs: 3 395562.2030376.qx3zqy7 LAB ACTIVITY 1 #include <iostream> 2 using namespace std; 3 12.11.1: LAB: Count the digits 4 /* TODO: Write recursive DigitCount() function here. */ 5 6 7 int main() { 8 9 10 11 12 13 14 15 int num; int digits; main.cpp cin >> num; digits DigitCount (num); cout << digits << endl; return 0; 0/10 Load default template...