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]
3 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]3 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]3 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
Everfi module 7 answers
Nat2105 [25]
What is the question?
7 0
3 years ago
Which of the following views would you use to see your Web page while working on it?
brilliants [131]
D) Alt Tags thats the answer i think
8 0
3 years ago
Providing incentives for customers to learn more about your service is known as?
Julli [10]
B) Advertising is the answer
3 0
3 years ago
Samantha received a gaming session as a gift. She would like to have it communicate with her sister Jennifer’s gaming system so
WARRIOR [948]

Answer:

Wi-Fi Direct

Explanation:

Wi-Fi Direct is a Wi-Fi standard for peer-to-peer wireless connections that allows two devices to establish a direct Wi-Fi connection without an intermediary wireless access point, router, or Internet connection.

3 0
3 years ago
You have decided to install the DNS server role on Nano Server. What specific type of zone configuration is not supported when u
nadya68 [22]

Answer:Active Directory-integrated

Explanation: Active Directory-integrated is the service that is introduced by the Microsoft .This service provides the directory form for functioning in Windows. It serves the purpose of active directory(AD) transferring to the Dynamic web database. Whenever the user gets connected to any website, it provides validation to qualifications . So, it does not get support the specification when there is working of DNS.

4 0
3 years ago
Other questions:
  • The waterfall model and spiral model are variations of SDLC. Do some research to find out what they are and explain how these mo
    14·1 answer
  • What did Fulton design in addition to the steamboat
    5·1 answer
  • Which of these is the proper flow for an Auto Trans cooling system?
    7·2 answers
  • What is the meaning of web browser
    11·1 answer
  • What is modularity? Help asap
    9·1 answer
  • Is a pocket watch consider a computer
    15·1 answer
  • Coral Given three floating-point numbers x, y, and z, output x to the power of y, x to the power of (y to the power of z), the a
    6·1 answer
  • Please Helpppp Me User Interface Design ensures that the interface has elements that are easy to ________________. (Choose all t
    8·1 answer
  • What study skill is being used when taking a large project and breaking it down into smaller manageable tasks?
    5·2 answers
  • Helppppppppppppppp me please Can i have help for a ggogle class room
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!