Jumping statement:-
The Jumping Statement can be defined as which guides the program counter to jump from one statement to another statement.
The division of the jumping statement can be understandable through the digram:-
Note:-
program counter:- it is a special type of pointer used to store the address of next to be executed.
According to the execution of the program, it can be of 2 types.
- Procedural Programming:-The method of solving a problem in a step by step method is known as Procedural Programming.
- Modular Programming:-The method of dividing the whole program into some sets of subprograms method is known as Procedural Programming.
Note:-
MATLAB is an example of both procedural and modular programming language. However, it also can be used as an object-oriented language.
Condition:-
The condition or conditional statement is mainly referring to the conditional movement of the programme counter.
How a condition statement is working is shown below:-
(Algorithm of Condition Statement) |
it is divided into 5 types. such as:-
- if...end
- if...else...end
- if...elsseif...elseif...end
- nested if
- switch
The syntactical representation of all conditions is:-
1. if...end:-
if(condition)
........
........
........
end
2. if...else...end:-
if(condition)
........
........
........
else
........
.......
.......
end
3. if...elseif.....elseif....else...end:-
if(condition)
........
........
........
elseif(condition)
..........
..........
..........
else
..........
..........
..........
end
4. nested if:-
nested if or if-else ladder is aggeration of two or more condition statement.
it is not having any special type of syntax.
5. Switch:-
switch(expression / variable)
case value 1
............
............
............
case value 2
............
............
............
case value 3
............
............
............
otherwise
............
............
............
end
Post a Comment
If you have any doubts regarding this topic...
feel free to ask...