Looking For Anything Specific?

ads header

Algorithm and Flowchart in C Language - Code With Manshi

There are two types of tools to explain the process of a program is called Algorithm and Flowchart.
  • 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 -
  1. An Algorithm uses a definite procedure.
  2. Algorithm has its own logical sequence so it is easier to debug.
  3. It is a step wise repressenttation of a solution to given problem, which makes ait easy to understand.
  4. 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 -
  1. Flowchart is an excllent way to communicating the logic of a program.
  2. During Program development cycle, the flowchart play the roll of a blueprint, which makes program development process easier.
  3. 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);
}

 OUTPUT 
Enter a and b = 2 3
c = 5

Difference between algorithm and flowchart in table form


Post a Comment

0 Comments