|
Arithmetic Instructions
|
These types of instructions are used
to perform arithmetic operations between constants andvariables.
|
Some of the arithmetic operators are: +,
-, * and /.
|
Example:
|
int a;
|
float b, deta, alpha, gamma, beta;
|
a=500;
|
b=0.0056;
|
deta=alpha*beta/gamma+0.5*2/5;
|
There are three types of arithmetic statements:
|
1. Integer mode arithmetic statement:
|
In this type of arithmetic statement
all operands are either integer variable or integer
constant.
|
2. Real mode arithmetic statement:
|
In this type of arithmetic statement
all operands are either real constant or real
variables.
|
3. Mixed mode arithmetic statement:
|
In this type of arithmetic statement
some of the operands are integer and some of them are real.
|
Control Instructions
|
These types of instructions are used
for controlling the sequence of execution of various statements in C program.
It determines the 'flow of control' in a program.
|
There are four types of control
instructions in C:
|
1. Sequence Control Instructions
|
The sequence control instruction ensures
that the instructions are executed in the same order in which they appear in
the program.
|
2. Selection or Decision Control
Instructions
|
These types of instruction allow the
computer to take a decision.
|
3. Case Control Instruction
|
These types of instruction determine
which instruction is to be executed next.
|
4. Repetition or Loop Control
Instruction
|
The loop control instruction helps
computer to execute a group of statements repeatedly
|
More Topics :