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

Step Form Algorithm

The document describes three ways to solve quadratic equations: 1. A step-by-step algorithm that uses printf and scanf functions to input coefficients and displays the roots. 2. A pseudo code algorithm that uses specific variables and formulas to calculate the discriminant and roots. 3. A flowchart representation using standard symbols like processing, decision, and input/output to visually depict the logic flow of calculating roots.

Uploaded by

CHRISTIAN GERALD
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
948 views

Step Form Algorithm

The document describes three ways to solve quadratic equations: 1. A step-by-step algorithm that uses printf and scanf functions to input coefficients and displays the roots. 2. A pseudo code algorithm that uses specific variables and formulas to calculate the discriminant and roots. 3. A flowchart representation using standard symbols like processing, decision, and input/output to visually depict the logic flow of calculating roots.

Uploaded by

CHRISTIAN GERALD
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Step Form Algorithm:

 Start.
 Declare the required variables.
 Indicate the user to enter the coefficients of the quadratic equation by displaying suitable
sentences using printf() function.
 Wait using the scanf() function for the user to enter the input.
 Calculate the roots of quadratic equation using the proper formulae.
 Display the result.
 Wait for user to press a key using getch() function.
 Stop.

Pseudo Code Algorithm:

 Start.
 Input a, b, c.
 D ← sqrt (b × b – 4 × a × c).
 X1 ← (-b + d) / (2 × a).
 X2 ← (-b - d) / (2 × a).
 Print x1, x2.
 Stop.

Flowchart:

Flowchart to calculate the roots of quadratic equation is shown below in figure 3.


Symbols Used In Flowchart
Different symbols are used for different states in flowchart, For example: Input/Output and
decision making has different symbols. The table below describes all the symbols that are used in
making flowchart

Symbol Purpose Description


Used to indicate the flow of logic by connecting
Flow line
symbols.

Terminal(Stop/Start) Used to represent start and end of flowchart.

Input/Output Used for input and output operation.

Processing Used for airthmetic operations and data-manipulations.

Used to represent the operation in which there are two


Desicion
alternatives, true and false.

On-page Connector Used to join different flowline

Off-page Connector Used to connect flowchart portion on different page.

Predefined Used to represent a group of statements performing one


Process/Function processing task.

Examples of flowcharts in programming

Draw a flowchart to add two numbers entered by user.

Draw flowchart to find the largest among three different numbers entered by user.
Draw a flowchart to find all the roots of a quadratic equation ax2+bx+c=0
Draw a flowchart to find the Fibonacci series till term≤1000.

Though, flowchart are useful in efficient coding, debugging and analysis of a program, drawing
flowchart in very complicated in case of complex programs and often ignored.

You might also like