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
Keyboards that are widely used on various smartphones and other small portable devices, and which are designed primarily for com
mr Goodwill [35]

Answer:

Option A is the correct answer for the above question.

Explanation:

The keyboard is a device, by which a human can instruct the computer in the text form. There are so many keyboards in which, thumb keyboard is one of them. The thumb keyboard is found in mobile phones, smartphones or PDA phones, which is used for personal use. It is a designed layout of the keyboard that can be placed on the hand of the human and a person can type on its with the help of his thumb.

The above question asked about the type of the keyboard which is used in various smartphones and other phones. That keyboard is thumb keyboard which is described above and it is stated from the option A. So option A is the correct answer while the other is not because--

  • Option B states about the traditional keyboard which is used for the PC only.
  • Option C states about the Notebook keyboard which is used for the Notebook computers only.
  • Option D states about combination which is not a type of keyboard.
7 0
3 years ago
What are the advantages of using a vpn?​
Fantom [35]

Answer:

Changing ip address to avoid ip ban. keeping your personal info safe while on public connections

Explanation:

Looked it up.

5 0
2 years ago
11)When, if ever, will the geometric average return exceed the arithmetic average return for a given set of returns?A) When the
grigory [225]

Answer: E. Never

geometric average return can NEVER exceed the arithmetic average return for a given set of returns

Explanation:

The arithmetic average return is always higher than the other average return measure called the geometric average return. The arithmetic return ignores the compounding effect and order of returns and it is misleading when the investment returns are volatile.

Arithmetic returns are the everyday calculation of the average. You take the series of returns (in this case, annual figures), add them up, and then divide the total by the number of returns in the series. Geometric returns (also called compound returns) involve slightly more complicated maths.

6 0
3 years ago
Who were 4 major people that attended the constitutional convention
postnew [5]
Alexander Hamilton, George Washington, James Madison, and Benjamin Franklin
7 0
3 years ago
How do Hlookup and Vlookup differ?
german

HLOOKUP performs the same function as VLOOKUP, but looks up data that has been formatted by rows. HLOOKUP searches for a value in the top row of a table, and then returns a value in the same column from a row you specify in the table or array

6 0
3 years ago
Read 2 more answers
Other questions:
  • Jason is working on a project that requires him to manage a huge amount of data. The spreadsheet he is working on has data relat
    12·1 answer
  • Naseer has inserted an image into his document but needs the image to appear on its own line.
    14·2 answers
  • Which task manager tab provides details about how a program uses system resources?
    14·1 answer
  • How many questions must you answer in Brainly to be able to message people?
    6·2 answers
  • The Status bar is used to control the majority of the drafting settings in AutoCAD
    13·1 answer
  • Which is true about POP3 and IMAP for incoming email?
    10·1 answer
  • What is the square root of 1600 and 36 ?​
    6·1 answer
  • 1.What is the term referring to an amount of money that is owed?
    6·2 answers
  • Select the correct answer.
    15·2 answers
  • Which actions are available in the Trust Center? Check all that apply.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!