2.Before learning any programming language you should learn this !

What is a variable?


Almost every algorithm contains data and usually, the data is ‘contained’ in what is called a variable. 

The variable is a container for a value that may vary during the execution of the program

For example the addition of two numbers required two values which are stored in two different variables like value1 and value2.

So here value1 and value2 are the two different variables, its value may change during program execution.

Variables and data types :

The data used in algorithms can be of different types. 

The simplest types of data that an algorithm might use are  

numeric data, e.g., 12, 11.45, 901, etc. 

alphabetic or character data such as ‘A’, ‘Z’, or ‘This is alphabetic’ 

logical data, that is, propositions with true/false values


Different ways of stating algorithms:

There are three ways of stating algorithms:

1.Step-form 

2.Pseudo-code

3.Flowchart


 


Post a Comment

0 Comments