Question: Hello can you help solve this problem num 5, 6 , 7 ? Thank you 4. What is the output of the following code? int

Hello can you help solve this problem num 5, 6 , 7 ?

Hello can you help solve this problem num 5, 6 , 7

Thank you

4. What is the output of the following code? int x = 50, y = 60, z = 70; int *ptr; ptr = &x; *ptr *= 10; ptr = &y; "ptr *= 5; ptr = &z; *ptr *= 2; 5. Assume pint is a pointer variable. Is each of the following statements vaid or invalid? If any is invalid, why? a. pint++ b. -pinti c. pint /= 2; d. pint *= 4; e, pint += x; // Assume x is an int. 6. Is each of the following definitions valid or invalid? If any is invalid, why? a. int ivar; int *ptr = &ivar; b. int ivar, *1ptr = &ivar; c. float fvar int *ptr = &fvar; d, int nums [50], *iptr= nums ; e, int *iptr = &ivar; int ivar; 7. The following function uses reference variables as parameters. Rewrite the function definition so it uses pointers instead of reference variables as input parameters. There is no change in the return type. int doSomething (int &x, int y int temp = x; x=y*10; y temp * 10; return x t y

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!