Subscribe

Header Ads

Instructions in C




 

Instructions: Instructions are the commands used to instruct the compiler to do certain actions.

3 types of instructions in C language are:

a. Type declaration instruction: It is the instruction used to declare the type of variables in the C program.

For Example: 
int roll_no;
char name;
float percentage;


b. Arithmetic instruction: The instruction which is used to perform the arithmetic operations between contacts and variables is known as an arithmetic declaration.

For example:
percentage = (marks / total) * 100;


c. Control instruction: The instruction which is used to control the sequence of execution of various statements is known as a control instruction.

There are four types of control instructions in C:

  • Sequence Control Instruction:

It ensures that the instructions are executed in the same order as appeared in the program.

  • Selection or Decision Control Instruction :

It allows the computer to make the decision that which instruction is to be executed next.

  • Repetition or Loop Control Instruction:

It is used to execute the given set of statements repeatedly.
  • Case-Control Instruction

Post a Comment

0 Comments