Online C programming exercises


What is the the value of the firstvalue?

int main ()
{
int firstvalue = 5, secondvalue = 15;
int * p1, * p2;
p1 = &firstvalue;
p2 = &secondvalue;
*p1 = 10;
*p2 = *p1;
p1 = p2;
*p1 = 20;
printf("firstvalue is %d",firstvalue );
printf("secondvalue is %d",secondvalue );
return 0;
}



Enter the result



Next Exercise