Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
35 views

Algo and Flowchart

The document discusses several algorithms and flowcharts for different computational problems: 1. An algorithm to find the sum of two numbers by inputting the numbers, calculating their sum, and outputting the result. 2. An algorithm to find the sum, average, and product of three numbers by reading the numbers, calculating each result, and displaying the outputs. 3. An algorithm to determine the largest of two values by comparing them, assigning the largest to a variable, and printing the result.

Uploaded by

HEALTHY TRICKS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Algo and Flowchart

The document discusses several algorithms and flowcharts for different computational problems: 1. An algorithm to find the sum of two numbers by inputting the numbers, calculating their sum, and outputting the result. 2. An algorithm to find the sum, average, and product of three numbers by reading the numbers, calculating each result, and displaying the outputs. 3. An algorithm to determine the largest of two values by comparing them, assigning the largest to a variable, and printing the result.

Uploaded by

HEALTHY TRICKS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Start or end of the program

Computational steps or processing


function of a program

Input or output operation

Decision making and branching

Connector or joining of two parts of


program
• Design an algorithm and flowchart to find the
sum 2 numbers (A, B).
– Variables:
• A: First Number
• B: Second Number
• C: Sum (A+B)
– Algorithm:
• Step 1 – Start
• Step 2 – Input A
• Step 3 – Input B
• Step 4 – Calculate C = A + B
• Step 5 – Output C
• Step 6 – Stop
• Design an algorithm and flowchart to find the
sum, average and product of 3 numbers (X,Y,Z)
1- Simple sequential Flowchart

- Read X, Y, Z - Compute Product (P) as


- Compute Sum (S) as X + X xYxZ
Y +Z - Write (Display) the Sum,
- Compute Average (A) as Average and Product
S/3
Design Algorithm and Flowchart
• Find the difference and the division of two numbers
and display the result
• Write an algorithm that reads two values,
determines the largest value and prints the
largest value with an identifying message.
ALGORITHM

Step 1: Input VALUE1, VALUE2


Step 2: if (VALUE1 > VALUE2) then
MAX  VALUE1
else
MAX  VALUE2
endif
Step 3: Print “The largest value is”, MAX
Flowchart
• START

• Input
• VALUE1,VALUE2

• Y • is • N
• VALUE1>VALUE2


MAX  VALUE1 •
MAX  VALUE2
• Print
• “The largest value is”, MAX

• STOP
C:Structured Programming Language
• It refers to programming strategy that encompasses a number
of methodologies to produce good quality design code, which
can be easily understood. 3 main principle of SPL is :
– Program design using top-down or bottom-up approach.
– Decomposition of program into components, ie. Modular
programming.
– Structuring of Control flow.
• It is also called middle level language because it support both
system programming and application programming.

You might also like