Mask-group

C Instructions



There are 3 types of instructions in C:

  1. Type Declaration Instructions - To declare the type of variables used in a C program.

  2. Arithmetic Instructions - To perform arithmetic operations between constants and variables.

  3. Control instructions - To control the sequence of execution of various statements in a C program.

Arithmetic Instructions:

  • It consists of a variable name on the left hand side equal to symbol (=) and variable,constant names and values on the right hand side equal to symbol (=) are connected by arithmetic operators.

  • Example:

int a=5;

float a,b,c,d=5000;

a= c*d/b-c;

Arithmetic Statements are of Three Types:

  1. Integer mode arithmetic statement -
  • In this all operands are either integer variables or integer constants.
  • Example: int i,j,k,l;

i = i+2;

l = j * 24 + k - 5;

  1. Real mode arithmetic statement -
  • In this all operands are either real constants or real variables.
  • Example: float a,b,c,d;

c = a +34.5/2.5 * 12.0; 

  1. Mixed mode arithmetic statement -
  • In this some of the operands are integers and some of the operands are real.

  • Example: float a,b,c;

int i,j,k;

i = (j+k)/2;

a = 2.5 + (b+c) / 3.5;