Write An Algorithm and Draw A Corresponding Ow Chart To Print The Sum of The Digits of A Given Number
Write An Algorithm and Draw A Corresponding Ow Chart To Print The Sum of The Digits of A Given Number
Write an algorithm and draw a corresponding flow chart to print the sum of the digits of a given number 10m
Dec2005
An algorithm is a finite set of steps defining the solution of a particular problem. An algorithm is expressed in
pseudo code – something resembling C language or Pascal, but with some statements in English rather than within
the programming language
1. A sequential solution of any program that written in human language, called algorithm.
2. Algorithm is first step of the solution process, after the analysis of problem, programmers write the algo-
rithm of that problem.
Pseudo code:
Input a Number
Initialize Sum to zero
While Number is not zero
Get Remainder by Number Mod 10
Add Remainder to Sum
Divide Number by 10
Print sum
Detailed Algorithm:
cssimplified.com/c-cpp-programming-data-structure/write-an-algorithm-and-draw-a-corresponding-flow-chart-to-print-the-sum-of-the-digits-of-a-given-n… 1/3
7/14/2021 Write algorithm & flowchart to print sum of digits of number | Computer Science Simplified - A Website for IGNOU MCA & BCA Students f…
N = N / 10;
Flowchart:-
Q Write a recursive program to find the G.C.D. of the two given numbers. 10m Dec2005
cssimplified.com/c-cpp-programming-data-structure/write-an-algorithm-and-draw-a-corresponding-flow-chart-to-print-the-sum-of-the-digits-of-a-given-n… 2/3
7/14/2021 Write algorithm & flowchart to print sum of digits of number | Computer Science Simplified - A Website for IGNOU MCA & BCA Students f…
This site uses Akismet to reduce spam. Learn how your comment data is processed.
cssimplified.com/c-cpp-programming-data-structure/write-an-algorithm-and-draw-a-corresponding-flow-chart-to-print-the-sum-of-the-digits-of-a-given-n… 3/3