Question: 1. Enter and run the following program. Show the values printed and answer the questions that follow. #include main(){ int x = 5; int *ptr_x;

1. Enter and run the following program. Show the values printed and answer the questions that follow.

#include main(){ int x = 5; int *ptr_x; ptr_x = &x; printf(" The value of x is %d", x); printf(" The value of *ptr_x is %d", *ptr_x); printf(" The address of x is %X", &x); printf(" The value of ptr_x is %X", ptr_x); printf(" The address of ptr_x is %X, &ptr_x); printf( The value of ptr_x +1 is %X, ptr_x+1); *ptr_x = 10; printf( The new value of x is %i , x);

}

What can you say about the value of x and the value of *ptr_x ? ________________

What can you say about the address of x and the value of ptr_x? ________________

What is the new value of x? ___________

How did it get changed?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!