You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using namespace std;int numberOfDigits(int n){if(n==0){return 0;}else{return 1+numberOfDigits(n/10);}}int main(){int num;cout<<"Enter a number: ";cin>>num;cout<<"\nThe number of digits in "<<num<<" are "<<numberOfDigits(num);return 0;}