Friday, February 1, 2019

Number of digits

  • Problem Description

    Write a program to find the number of digits in the given number
  • CODING ARENA
  • n=int(input())
    count=0
    while(n>0):
        count=count+1
        n=n//10
    print(count)
  • Test Case 1

    Input (stdin)
    655839983
    
    
    Expected Output
    9
  • Test Case 2

    Input (stdin)
    345554447432
    
    
    Expected Output
    12

No comments:

Post a Comment