answersLogoWhite

0


Best Answer

Well, it's very hard to write a flowchart in text, so I'll give you some pseudo code instead.

int number = the given number

int sum = 0

loop while number is not 0

sum = sum + (number mod 10)

number = number / 10

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

#include
#include
void main()
{
int n,sum,r;
clrscr();
printf("Enter an Integer: ");
scanf("%d",&n);
sum=0;
while(n>0)
{
r=n%10;
sum=sum+r;
n=n/10;
}
printf("Sum of Digits: %d",sum);
getch();
}

output:
Enter an Integer:
1234
Sum of Digits: 10




1. Start the program.
2. Input n.
3. Initialize as sum=0;
4.using while loop test condition as (n>0)
5. If this derives to true then next move to body of the loop.
6. body of the loop.
7. Process as follows
i. Store the remainder in r by Modulo Division the given number by 10.
r=n%10;
ii. Add the remainder to the summation
sum=sum+r;
iii. Again divide the n by 10 and store the value in n.
n=n/10;
8. Again the loop tests for n>0
9. When n becomes less than 0 the loop terminates
10. Finally the out put prints the sum of digits of a given integer

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

sum of individual digit of a positive integer

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

the sum of individual digits of a given integer number

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

draw a flow chart to arange the given data in ascending order

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

2

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Individual digits sum with flowchart and algorithm?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write algorithm and draw flowchart to find the sum of even numbers?

jgfujtf


Give a sample problem with the use of algorithm and flowchart symbols?

design a flowchart that will input three numbers and get their sum. If the sum is greater than 20, then print "sum>20",else print the sum.


Algorithm for to find sum of individual digits of a positive integer?

enter the number whose digits are to be added num is the given value num=0! k=num%10 sum=sum=k k=num/10 num=k print the sum of the digits


Write the algorithm and draw the flowchart to find Sum of N Prime number?

Shrek and Donkey


How do you write and draw an algorithm in flowchart for Add 2 and 4 and print the sum?

2+4


What is an algorithm to calculate the sum of the digits of a three digit number?

algorithm is a way to solve your problem


What is sum of individual digits?

The sum of the individual digit is itself


What will be the Flowchart for adding all elements in an array in c plus plus?

It is not possible to show a flowchart in this website -- it is text only. The algorithm can be summarised as follows: int sum(std::array<int>& a) { int sum = 0; // initialise the return value for (auto i : a) // for each value in the array sum += i; // increment the sum by the value return sum; // return the sum }


What is the smallest two digit number that can be divided by its own digits?

By the sum of its digits: 10. By each of its individual digits: 11.


Shell program to find the sum of square of individual digits of a number?

There are many shell programs that will find the sum of the square of individual digits of a number. A small example is: SD=3n=2, sum=2, and SD=2.


Write a Shell program to find the sum of cube of individual digits of a number?

no thanks


What is the algorithm and flowchart to find Sum of natural numbers from 1 to10?

The general equation to find the sum of the numbers 1 to n is: (n*(n+1))/2So, for n=10, you have:(10*(10+1))/2(10*11)/2110/255