1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
marin [14]
2 years ago
10

Write a program to input a number.Find the sum of digits and number of digits

Computers and Technology
2 answers:
BaLLatris [955]2 years ago
8 0

Answer:

<em>#Sum of Digits</em>

a = int(input("Enter a number: "))

sumofdigits = sum(int(dig) for dig in str(number))  

print("Sum of digits: ", sumofdigits)

<em># Number of digits</em>

count = 0  

print ("Total number of digits : ",len(str(abs(a))))

Explanation:

It is pretty self-explanatory however, I will tell it to you anyways. So, the sum of digits iterates to each digit and adds them up. For the number of digits, it uses in-built functions (length, string and absolute)

ki77a [65]2 years ago
7 0

omg a computer program

i love it

okay so i will assume taht you want the program to be in python

here we go

a = int(input("Enter a number ")

b = int(input("Enter another number ")

sum = a + b

def Digits(sum):

count = 0

while sum != 0:

sum //= 0

count += 1

return count

print(f"Sum is {sum} \nnumber of digits are {Digits(sum)}")

You might be interested in
What are some areas in Computer Science that make use of multivariate statistical testing or MCM methods? Explain why they are u
Nikolay [14]

Explanation:

Computational modeling is one of the areas of Computer Science that uses mathematical systems to perform multivariate statistical tests to solve highly complex problems in multidisciplinary areas, such as medicine, engineering, science, etc.

An example of the use of multivariate statistical tests is social development research in social science, which uses multiple variables to find more hypotheses and greater coverage between variables.

Multivariate statistical tests have the benefit of making research more effective and providing a more systematic and real view of the study.

6 0
2 years ago
The three logical operators recognized by most search engines are
Kisachek [45]
The three basic logical operators recognized by the most search engines are AND, OR and NOT. They are known as Boolean operators. <span>You can use Boolean operators in keywords on the internet in both advanced and customs searches on many search engines.</span>




8 0
3 years ago
How to write a survey on cat theory​
nalin [4]
Start with a bold statement then follow with facts solutions problems and theory’s
3 0
2 years ago
List different examples of models​
aleksley [76]

Answer:

Planet 3D model

Chemical reactions on a computer simulation

Flowchart of how science has changed over time

Tectonic plate movement in a drawing or picture

Making an Atom cake (i've done it and it was fun)

Earth foam Structure with a quarter or it cut out to show the inside

5 0
2 years ago
LIst types of computer process ?
vagabundo [1.1K]

Answer:

Transaction Processing.

Distributed Processing.

Real-time Processing.

Batch Processing.

Multiprocessing.

4 0
2 years ago
Other questions:
  • QUESTION : John travels a lot and he needs to access his documents and services on the go. Which of these technologies allows hi
    15·1 answer
  • When are numbered lists generally used?
    14·2 answers
  • You've decided to use a subnet mask of 255.255.192.0 with your 172.17.0.0 network to create four separate subnets. The network I
    13·1 answer
  • Give 5 uses of software and hardware.
    15·1 answer
  • A(n) _____ can replace many applications with one unified set of programs, making the system easier to use and more effective.
    8·1 answer
  • What are horizontal and vertical page break? how and where are these inserted?​
    10·1 answer
  • Why when you are on wifi it keeps kicking you off is your class during online learning​
    15·2 answers
  • Which statement describes what the Conditional Formatting option in Excel 2016 allows users to do?
    15·2 answers
  • Question in photo below
    13·2 answers
  • What feature should you enable to prevent the sidhistory attribute from being used to falsely gain administrative privileges in
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!