Examveda
Examveda

What will be the output of the following C code?
#include <stdio.h>
int x = 0;
void main()
{
    int *ptr = &x;
    printf("%p\n", ptr);
    x++;
    printf("%p\n ", ptr);
}

A. Same address

B. Different address

C. Compile time error

D. Varies

Answer: Option A


This Question Belongs to C Program >> Pointer

Join The Discussion

Related Questions on Pointer