Computer Science, asked by Sherlock76951, 2 months ago

Write a program that Input an integer between 1&9999 program should display how many integer has

Answers

Answered by anindyaadhikari13
4

\texttt{\textsf{\large{\underline{Solution}:}}}

The given co‎de is written in Python.

n=int(input('Enter a number: '))

print('Length of',n,'is:',len(str(n)))

\texttt{\textsf{\large{\underline{Logic}:}}}

  • Accept the number.
  • Convert the number to string.
  • Using len() fu‎nction, calculate the length of the number and display it.

See the attachment for output.

Attachments:
Similar questions