Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following C code?
#include < stdio.h >
int main()
{
register int i = 10;
int *p = &i;
*p = 11;
printf(“%d %d\n”, i, *p);
}

What will be the output of the following C code?
#include < stdio.h >
int main()
{
register int i = 10;
int *p = &i;
*p = 11;
printf(“%d %d\n”, i, *p);
}
a) Depends on whether i is actually stored in machine register
b) 10 10
c) 11 11
d) Compile time error

Answer: d

Join The Discussion