Computer Science, asked by ansariashraf7, 6 hours ago

Draw the flowchart to find the sum of digits of a given number. for e.g. if number n =145, sum of digits =1+4+5=10.​

Answers

Answered by Indianstar4841
2

Answer:

General Algorithm for sum of digits in a given number:

Get the number.

Declare a variable to store the sum and set it to 0.

Repeat the next two steps till the number is not 0.

Get the rightmost digit of the number with help of the remainder '%' operator by dividing it by 10 and add it to sum.

Similar questions