Algorithm and Flowchart

Back - C Language Notes By Vivek Sir email: vivekdubey22@gmail.com (w) 9826424484

Algorithms and flowcharts are two different tools used for creating new programs, especially in computer programming. An algorithm is a step-by-step analysis of the process, while a flowchart explains the steps of a program in a graphical way.

What is an Algorithm?

To write a logical step-by-step method to solve the problem is called algorithm, in other words, an algorithm is a procedure for solving problems. In order to solve a mathematical or computer problem, this is the first step of the procedure. An algorithm includes calculations, reasoning and data processing. Algorithms can be presented by natural languages, pseudo code and flowcharts, etc.

Example 1: Convert Temperature from Fahrenheit () to Celsius ()

Algorithm:

Step 1: Read temperature in Fahrenheit,

Step 2: Calculate temperature with formula C=5/9*(F-32),

Step 3: Print C,

 

Example 2: Print 1 to 20:

Algorithm:

Step 1: Initialize X as 0,

Step 2: Increment X by 1,

Step 3: Print X,

Step 4: If X is less than 20 then go back to step 2 else end the program.


 

What is a Flowchart?

·         A flowchart is a graphical representations of steps. It was originated from computer science as a tool for representing algorithms and programming logic but had extended to use in all other kinds of processes. Nowadays, flowcharts play an extremely important role in displaying information and assisting reasoning. They help us visualize complex processes, or make explicit the structure of problems and tasks. A flowchart can also be used to define a process or project to be implemented.

Flowchart Symbols

Image result for FLOWCHART SYMBOLS

Flowchart Example – Simple Algorithms

A flowchart can also be used in visualizing algorithms, regardless of its complexity. Here is an example that shows how flowchart can be used in showing a simple summation process.

 


 

Exp1: Convert Temperature from Fahrenheit () to Celsius ()

Flowchart Algorithm 2

 

 

 

 

 

Exp2: Print 1 to 20:

 

Flowchart Algorithm

 

 

C Language Video

Back - C Language Notes By Vivek Sir email: vivekdubey22@gmail.com (w) 9826424484