- Algorithm - To write a step by step method to solve the problem is called Algorithm.
In other words, it is a solution of any problem in simple english language step-by-step is called algorithm. - Advantage of Algorithm -
- An Algorithm uses a definite procedure.
- Algorithm has its own logical sequence so it is easier to debug.
- It is a step wise repressenttation of a solution to given problem, which makes ait easy to understand.
- It is not depended on any programming language, so it is easy to understand anyone even without programming knowledge.
- Flowchart - It is a graphically / Diagramatic representation of any algorithm is known as flowchart, programmers often use it as a program-planning tool to solve a problem.
- It can uses different type of Diagrams -
- Advantages of Flowchart -
- Flowchart is an excllent way to communicating the logic of a program.
- During Program development cycle, the flowchart play the roll of a blueprint, which makes program development process easier.
- It would have been easy enough to convert a flowchart into any programming code.
- Example of algorithm and flowchart
- Example 1 :
PROGRAM
#include<stdio.h>
void main()
{
int a,b,c;
printf("Enter a and b = ");
scanf("%d %d",&a,&b);
c=a+b;
printf("c = %d",c);
}
void main()
{
int a,b,c;
printf("Enter a and b = ");
scanf("%d %d",&a,&b);
c=a+b;
printf("c = %d",c);
}
OUTPUT
Enter a and b = 2 3
c = 5
Difference between algorithm and flowchart in table form

0 Comments
If You Have Any Doubt, Please Let Me Know,