prasiddhachaulagain9 prasiddhachaulagain9
  • 21-08-2021
  • Computers and Technology
contestada

Write a algorithm to calculate the sum of digits in a given three digit number

​

Respuesta :

XxItzPaglisBandixX
XxItzPaglisBandixX XxItzPaglisBandixX
  • 21-08-2021

[tex]{\huge{\pink{↬}}} \:  \: {\huge{\underline{\boxed{\bf{\pink{Answer}}}}}}[/tex]

Sum of digits algorithm

Step 1: Get number by user.

Step 2: Get the modulus/remainder of the number.

Step 3: sum the remainder of the number.

Step 4: Divide the number by 10.

Step 5: Repeat the step 2 while number is greater than 0.

Answer Link

Otras preguntas

Who has pennfostsr answers?
Find k such that x² + (k + 1)x + k + 4 = 0
how can you tell that a fraction corresponds to a repating decimal and not a terminating decimal
how many hydrogen bonds can a single water molecule form
how can you tell that a fraction corresponds to a repating decimal and not a terminating decimal
What's 32xy divided by 24yz and how do you figure it out.  The question also asks me to write it as a fraction then cancel (or reduce).
5 FRIENDS GO OUT TO LUNCH AND ORDER 5 PIZZAS, THE FRIENDS DIVIDED THE PIZZAS EVENLY.FIND HOW MUCH PIZZA EACH FRIEND GOT AS A DECIMAL
Write 314,207 in expanded form
Which answer is closest to the true value of the expression: (9.1 x 10⁴)(1.1 x10^{-5})(log10^{-13})(1000) (a) 1.3  (b) 13000  (c) -13000  (d) 1.3 x 10^{-11} Can
It costs a dollars for an adult ticket to a reggae concert and s dollars for a student ticket. The difference between the cost of 12 adult tickets and 18 studen