- A pseudo code is an informal was to describe a program
- Pseudo code is not a computer program
- Pseudo code can use natural language or compact mathematical notation
- It is a rough sketch of the actual program

- No standard for pseudo code syntax exists
- So we don’t have to follow any strict syntax like computer programming language
- Pseudo code vary in style from author to author
- Pseudo code commonly borrows its syntax from popular programming languages like C, Fortran, Pascal, Java etc.

- We write algorithms to solve problems
- Algorithms are broken down into modules
- Some problems are simple so they have simple algorithms and few modules
- Some problems are complex so they have complex algorithms which have more modules

We can give any reasonable name to an algorithm module.

Example

`Sum()`

For algorithm with more than one word name we will use camel-case.

Example

`FindHighScore()`

Note! First letter of every word is in upper-case.

Camel-case is also used in which each word starts with a capital letter except the first word.

Example

`findTime()`

We will use lowercase for variable name.

Example

```
name
age
```

For more than one word variable we will use camel-case.

Example

```
highScore
isGameOver
```

Note! Variable name will start with lower-case.

For initializing variable we will use the word Set

Example

`Set score = 0;`

Initializing several variables

`Set x = 0, y = 0, score = 0, isGameOver = false;`

Note! Above statement will be executed from left to right.

Data may be input and assigned to variable using Read statement.

`Read: variable list`

Example

`Read: x;`

Or`Read: x, y, z;`

Note! Value will be assigned from left to right.

Message and data in variables may be output by using Write or Print statement.

`Write: Message and/or variable list`

or`Print: Message and/or variable list`

Example

```
Write: “Hello World”; //message
Print: “Value of x = ”, x; //message and variable
```

Note! Message and variable is separated by comma , [similar to Python programming]We can also use the + sign to join message and variable [similar to JavaScript]

Algorithm will start with a Begin statement and will end with an End statement.

Algorithm is completed with the execution of the last instruction.

However, we can terminate the execution at any stage using Exit instruction.

We generally divide complex problem into small manageable sub problems and then we develop algorithm for each of the sub problems, called sub algorithm.

- Sub algorithm is also referred as module
- Sub algorithm can not run on its own
- We need to call it either from main algorithm or from another sub algorithm
- Sub algorithm is given a name
- It can also have parameter list
- It can return value using return statement

We will use the **Call** statement to call any algorithm module from another module.

Recently Updated

- Product of Sums reduction using Karnaugh Map Boolean Algebra
- Sum of Products reduction using Karnaugh Map Boolean Algebra
- Karnaugh Map Boolean Algebra
- Sum of Products and Product of Sums Boolean Algebra
- Minterm and Maxterm Boolean Algebra
- Basic laws and properties of Boolean Algebra Boolean Algebra
- Propositional Logic Syllogism Boolean Algebra
- Propositional Logic Equivalence Laws Boolean Algebra
- Propositional Logic Important Terms Boolean Algebra
- Propositional Logic Truth Table Boolean Algebra