- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is an algorithm and flowchart in C language?
Algorithm is a step – by – step procedure which is helpful in solving a problem. If, it is written in English like sentences then, it is called as ‘PSEUDO CODE’.
Properties of an Algorithm
An algorithm must possess the following five properties −
- Input
- Output
- Finiteness
- Definiteness
- Effectiveness
Example
Algorithm for finding the average of three numbers is as follows −
- Start
- Read 3 numbers a,b,c
- Compute sum = a+b+c
- Compute average = sum/3
- Print average value
- Stop
FLOW CHART
Diagrammatic representation of an algorithm is called flow chart.
Symbols used in flowchart are mentioned below −
Name | Symbol | Purpose |
---|---|---|
Terminal | Oval | start/stop/begin/end |
Input/output | Parallelogram | Input/output of data |
Process | Rectangle | Any processing to be performaed can be represented |
Decision box | Diamon | Decision operation that determine which of the alternative paths to be followed |
Connector | Circle | Used to connect different parts of flowchart |
Flow | Arrows | Join 2 symbols and also represents flow of execution |
Pre defined process | Double Sided Rectangle | Module (or) subroutines specified else where |
Page connector | Pentagon | Used to connect flowchart in 2 different pages |
For loop symbol | Hexagon | shows initialization, condition and incrementation of loop variable |
Document | Printout | Shows the data that is ready for printout |
Example
Given below is the flowchart for finding an average of three numbers −
Advertisements