C – Register

C – Register 2017-07-25T15:23:18+00:00

Register storage class

  • Physical storage space can be a variable that is the main storage. With access to the registers in the CPU is faster than main memory, a register variable to register the specified variable is the physical storage space of variables. However, they require that as much as possible to ensure the register, the register guarantee is not necessarily secure.
  • Register variables are stored in the register of the microprocessor. The number of variable which can be declared register are limited. This means that the variable has a maximum size equal to the register size. If more variables are declared as register variable, they are treated as auto variables.
  • A program that uses register variables executes faster as compared to similar program without register variable.
  • To declare a variable register storage class register specified.
    register int n;

C – REGISTER STORAGE CLASS EXAMPLE PROGRAM :

Output :

Enter first number

10

Enter second number

20

The sum of 10 and 20 is 30

 

Prev Next