What is pseudocode? Give an example for pseudocode.

3 years ago
C Programming

Definition of Pseudocode

Pseudocode is high level description of an algorithm that contains a sequence of steps written in combination of english and mathemetical notations to solve a given problem.

Pseudocode is part english and part program logic.

Pseudocodes are better than algorithm since it contains ordered steps and mathemetical notations they are more closer to the statements of programming language.

 

This is essentially an intermediate-step towards the development of the actual code(program). Although pseudo code is frequently used, there are no set of rules for its exact writing.

Example:

Pseudocode 1: Pseudocode for finding area of traingle

Pseudocode Area_of_Traingle BEGIN

READ base and Height

CALCULATE Area_of_Triangle=(base*height)/2 PRINT Area_of_Triangle

END

Pseudocode 2:Pseudocode for finding sum and average of three numbers

Pseudocode SUM_AVG BEGIN

READ A, B, and C CALCULATE sum=A+B+C

CALCULATE average=SUM/3 PRINT sum and average

END

0
Sanisha Maharjan
Jan 20, 2022
More related questions

Questions Bank

View all Questions