Computer Science, asked by Mohamednabeel, 2 months ago

write an algorithm to find the sum of digits of a number ​

Answers

Answered by sajanvijayanandan
0

Answer:

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

Answered by Anonymous
2

Answer:

\huge \fbox \colorbox{orange}{Answer }

Explanation:

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.
Similar questions
Math, 1 month ago