Friday, September 4, 2009

C Instructions

Now that we have written a few programs let us look at the instructions that we used in these programs.

There are basically three types of instructions in C:
1.Type Declaration Instruction
2.Arithmetic Instruction
3.Control Instruction
The purpose of each of these instructions is given below:
Type declaration instruction

To declare the type of variables used in a C program.
Arithmetic instruction

To perform arithmetic operations between con-stants and variables.
Control instruction

To control the sequence of execution of various state-ments in a C program.

1.Type declaration Statement
The type declaration statement is written at the beginning of main( ) function.
Ex.: int bas ;
float rs, grosssal ;
char name, code ;

2.Arithmetic Instruction
A C arithmetic instruction consists of a variable name on the left hand side of = and variable names & constants on the right hand side of =. The variables and constants appearing on the right hand side of = are connected by arithmetic operators like +, -, *, and /.
Ex.: int ad ;
float kot, deta, alpha, beta, gamma ;
ad = 3200 ;
kot = 0.0056 ;
deta = alpha * beta / gamma + 3.2 * 2 / 5 ;


GetBlogs Blog Directory Subscribe to updates