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

What is larger: The height of a standard can of tennis balls, or the circumference of its lid? (Assume the can fits three tennis balls perfectly). Explain your
You are on a 650-mile trip. your car used eight gallons of gas to travel the first 210 miles of the trip. how much more gas will you need to make it the rest of
a1,a2,a3....a30-each of these 30 sets has 5 elements.b1,b2,....bn-each of these n sets has 3 elements.union of a1,a2...a30=union of b1,b2....bn=S. if each elem
True or false. 1) Adjacent angles are supplementary? 2) Same-side interior angles are supplementary? 3) Vertical angles are congruent?
is 12x=7y-10y a linear equation?
What are 2 ways of life in arabia?
1.3 yrs = ? hrs ...?
When a sucrose molecule is digested which monosaccharide are produced
Write two equations in standard form that are equivalent to the given equation. 1.5x+10y=15 2.-9x-12y=6 3.-2x+4y=-5
What does "a hyena can't know its own stretch" mean??