+ 1

How to count total no. Of digits in an integer array?

1st Mar 2018, 7:39 AM
saksham kumar sharma
saksham kumar sharma - avatar
2 Antworten
+ 7
Hint: - Prepare 2 variables totalDigits set to zero, and temp. - Use a for loop (x) to enumerate the array elements. - Inside for loop: > Assign element[x] to temp. > Use while loop with condition temp != zero. > Inside while loop: >> Increment totalDigits >> Divide temp by 10 - Upon exiting the loop, display totalDigits - Happy trying, and good luck! Hth, cmiw
1st Mar 2018, 10:04 AM
Ipang
0
😯😯😯
1st Mar 2018, 12:10 PM
Arun