Algorithm is a step-by-step process of solving problems. If it is written in a form that resembles an English sentence, it is called "pseudocode."
The algorithm must have the following five characteristics:
The algorithm for finding the average of three numbers is as follows:
The pictorial representation of an algorithm is called a flowchart.
The symbols used in the flow chart are as follows:
Name | Symbol | Purpose |
---|---|---|
Terminal | Oval | Start/Stop/Start/End |
Enter /Output |
Parallelogram |
Input/output of data |
Processing | Rectangle | Represents any processing to be performed |
Decision box | Diamond | Determine the alternative path to follow |
Connector | Circle | For connecting flowcharts Different parts |
Flow | Arrow | Connects two symbols, also represents the execution process |
Predefined procedures | Double-sided rectangle | Module (or) subroutine specified elsewhere |
Page Connector | Pentagon | Used to connect two different pages of the flowchart |
Loop symbol | Hexagon | Shows initialization, conditions, and increments of loop variables |
Documentation | Printout | Show preparation Printed data |
The following is a flow chart for finding the average of three numbers:
The above is the detailed content of An algorithm is a description of ordered steps for solving a problem. In C language, an algorithm is a series of instructions implemented programmatically. A flowchart is a tool that graphically represents an algorithm, using different symbols and arrows to represent different operations and processes.. For more information, please follow other related articles on the PHP Chinese website!