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

"He wrote the diary in a secret shorthand."Where is the simple predicate in the sentence above?
Please help I don't know what to do for number 40
what is the factor of both x^2 - x - 6 and x^2 - 5x + 6 ? please explain .
Which of the following elements is not necessary to prevent value conflicts in the work place? A. ToleranceB. ConsiderationC. AvoidanceD. Honest communication
Can someone help factor the expression  y2 + 10xy + 25x2
a giraffe can run about 14 meters per second find its speed in miles per hour
The Three-fifths compromise resulted in...
what decimal is equivalent to 122/11?
Both the leftmost digit and the rightmost digit of a four-digit number N are equal to 1. When these digits are removed, the two-digit number thus obtained is N
Toms home is 1800 m from his school. One morning he walked part of the way to school and then ran the rest. If it took him 20 minutes or less to get to school,