How to find the number of digits in a^b without using logarithm?
Answers
Answered by
1
Answer:
Logic to count number of digits in an integer
Input a number from user. ...
Initialize another variable to store total digits say digit = 0 .
If num > 0 then increment count by 1 i.e. count++ .
Divide num by 10 to remove last digit of the given number i.e. num = num / 10 .
Repeat step 3 to 4 till num > 0 or num !=
Step-by-step explanation:
Similar questions