Pseudo Code, Algorithm, Flow Chart and Programing




In computer Science , Any Programing Question will be answered by four ways...

1- Pseudo Code
2- Algorithm
3- Flow Chart
4- Programming (Coding)

Let's see all These with example.


Ques - Write a Program to take two numbers from users and return its sum along with its Pseudo code, Algorithm and Flowchart. 



♥ Pseudo Code

Pseudo Code is also called Program Design Language.
It is high level language.
It is used to wright steps of a program in English.
It is very simple to understand and easy to wright.

Answer-

Step 1- Include Header Files
Step 2- Declare three variables
Step 3- Get the input from user
Step 4- Perform operation (Sum operation)
Step 5-  Display Sum
Step 6- Terminate program



♥ Algorithm

Algorithm is an Step by Step instruction to performs operation.
It is well defined Language used to describe Programs.
It is written in English language with programing Syntax.
It is very efficient and very useful.
It can be expressed in finite amount of space and time.

Answer-

Step 1- Declare three variables
             num1, num2 and sum=0;
Step 2- Get input
             cin<< num1<<num2;
Step 3- perform operation
             sum=num1+num2;
Step 4- Display sum
             cout>>sum;
Step 5- Terminate program


♥ Flow Chart

Flow chart is a diagrammatical representation of flow of  execution in programs.
It has some specific Symbols to represent certain things



Answer -



Sourec - www.programiz.com Click Here..


♥ Programming (Coding)

It is written in coded language.
which can be executed using compiler (IDE)
It is difficult to understand

Answer -

# include <iostream.h>               //Header file
void main(){                                //Main function
int num1,num2,sum=0;               //variable declaration
cin<<num1<<num2;                   //getting user input
sum=num1+num2:                      //perform sum (operation)
cout>>"Your Sum is : "               //display on the screen
cout>>sum;                                 //display sum
}




By - Somesh Sah



Comments

Popular posts from this blog

Include Vs Import

Object Oriented Program (Paradigm)

Operators and Expressions