Register Variable C Language
Register is
a special type of storage medium for making variables in c language. When there
is a need of access any variable very frequently like inside of loops. For increase
of access time of a variable it can be take place direct on register. If a
variable is on a register then its take less time compare to access a variable
form memory because register is a part of CPU.
Syntax :
Register <data_Type>
Var_Name;
#include<stdio.h>
void main()
{
register int i;
i=1;
while(i<=10)
{
printf("\n%d",i);
i++;
}
}
No comments:
Post a Comment