Algorithms and Flowchart in C Language

 

Algorithms and Flowchart in C Language





What is an Algorithm?:

Algorithm is a step by step representation of program. These steps or procedures helps in solving the problem. Algorithm is set of rules that are followed to solve problem. These rules or steps helps to define how the work is to be executed to get desired output or result.


Steps in an Algorithm:

  1. Start

  2. Input

  3. Process

  4. Output

  5. End

For Example,

If you want to perform addition of two integers, then we can write an algorithm as follows,

Step 1: start

Step 2: Input two integers

Step 3: Compute sum=a+b

Step 4: Print sum

Step 5: Stop


Another example to get average marks of three subjects

Step 1: Start

Step 2: Input three subject’s marks

Step 3: Compute average=s1+s2+s3/3

Step4: Print average

Step5: Stop


What is Flowchart?:

Pictorial or diagrammatic representation of an algorithm is called flowchart. It is a graphical representation of an algorithm. Programmers can use it as a program planning tool to solve a problem. In flowchart the symbols are used to indicate the flow of information and processes. 

Click Here to see Symbols used in flowchart and how to draw the flowchart



टिप्पणी पोस्ट करा

0 टिप्पण्या