Algorithm and Flowchart

 Algorithm (Definition):

    An algorithm is a finite sequence of well-defined steps for solving a problem.
or
    An algorithm is a completedetailed, and precise step-by-step method for solving a problem independently.


Flowchart (Definition):
    A flowchart is a pictorial or graphical representation of a program or an algorithm.
or
    A flowchart is a pictorial representation of an algorithm depicting the flow of various steps.


Algorithm to find whether the number is even or odd:

Step 1: Read no.
Step 2: If no mod 2 = 0, go to step 4.
Step 3: Print no is odd, go to step 5.
Step 4: Print no is even.
Step 5: Stop


Flowchart to find whether the number is even or odd:




Drafted on 🌏 by,

Jal


peace

Comments

Popular posts from this blog

C program to read and display book information using structure

Count positive, negative and zero values in an array

Maximum value from array