Contact Learn C
Copy Program Share Program

Program 244:Register Storage Class in C

Program 244:
 
#include<stdio.h>
main()
{
 register int i;
 int j;
 for(i=1;i<10;i++)
 {
  for(j=i;j<10;j++)
  {
   printf("%d",j);
  }
  printf("\n");
 }
}


Explanation:

To access Variables faster.In the above program value from 'i' is accessed faster when compared to 'j' as 'i' is stored in CPU memory rather than storing in RAM.However,when the variable 'i' failed to store the value in CPU memory due to processor or if the processor is busy doing some other tasks then it is converted to Auto by default. //Coming Soon...

Output:

Register Storage Class in C





 

Download App and Learn when ever you want

Get it on PlayStore
Get it on Amazon App Store
Get it on Aptoide