Basic Knowledge About Instructions and Operators in C Language.
A Program is nothing but a set of instructions. The program behaves as per the instructions that we give in it. Different instructions help us achieve different task in a program.
In this article, we learn about Instruction, type of Instructions, Hierarchy of Operations and Associatively of Operators.
a) Type Declaration instructions :-
This instruction is used to declare the type of the variable being used in the program. Any variable used in the program must be declared before it is used in any statement. The type declaration statement is written at the beginning of main () function.
Ex. Int bas;
Float rs, grosssal;
Char name, code;
a) Arithmetic instructions:-
Hierarchy of Operations
The priority or precedence in which the operations are performed is called the Hierarchy of Operations.
The hierarchy of commonly used operators is shown as follow
Associatively of Operators.
When an expression contains two operators of equal priority, the tie between them is settled using the associatively of the operators. All operators in c have either left to right associatively or right to left associatively.
a) Control Instructions:-
As the name suggests, the ‘control instructions’ enable us to specify the order in which the various instructions in a program are to be executed by the computer. In other words, the control instructions determine the ‘flow of control’ in a program.
Comments
Post a Comment