Explore
ProGrad Programs
About Us

Edit
Reply




Edit

Count Number of Digits in an Integer | FACE Prep

Published on 09 Mar 2020

Program to count number of digits in an integer is discussed here. An integer is given as input and the total number of digits in that integer is displayed as output. Finding the number of digits in an integer can be done using loops, recursion, and a log-based solution can be also used.


Program to count number of digits in an integer using a loop


C
C++
Java
Python 3

Output
Input- Enter the number:1 2 3 4 5 6 Output- Number of digits:6


Program to count number of digits in an integer using recursion


C
C++
Java
Python 3

Output
Input- Enter the number:1 2 3 4 5 6 Output- Number of digits:6


Program to count number of digits in an integer using log based approach


C
C++
Java
Python 3

Output
Input- Enter the number:1 2 3 4 5 6 Output- Number of digits:6


Recommended Programs







If you have any feedback about this article and want to improve this, please write to enquiry@faceprep.in