study of pointers - 5.

#include <stdio.h>

int main(void)
{
int *p1, *p2, n1, n2;

n1 = 500;
n2 = -250;

p1 = &n1;
p2 = &n1;

if(p1 == p2)
{
printf("\nThe pointers are pointing to the same variable.");
}
else
{
printf("\nThe pointers are pointing to different variables.");
}

p2 = &n2;

if(p1 == p2)
{
printf("\nThe pointers are pointing to the same variable.");
}
else
{
printf("\nThe pointers are pointing to different variables.");
}


return 0;
}

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin