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>
void main()
{
int x = 4;
int *p = &x;
int *k = p++;
int r = p – k;
printf(“%d”, r);
}

What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 4;
int *p = &x;
int *k = p++;
int r = p – k;
printf(“%d”, r);
}
a) 4
b) 8
c) 1
d) Run time error

Answer: c

Join The Discussion