Question: Question 4 (3 points) 3 6 1. int main() { 2. float y = 56; 3. const float* ptr = &y; 4. *ptr++; 5. printf(%5.2f,

 Question 4 (3 points) 3 6 1. int main() { 2.

Question 4 (3 points) 3 6 1. int main() { 2. float y = 56; 3. const float* ptr = &y; 4. *ptr++; 5. printf("%5.2f", *ptr); return 0; } 1 12 Which of the following choices most correctly explains working of the above code? It displays 57 as the value is indirectly increased using pointer *ptr. It displays a garbage value because the pointer 'tr' was not properly dereferenced on line #4 5 It displays 0.00 because it reinitializes y via pointer ptr. It gives a syntax error as pointer 'tr' is declared as constant, yet it is incremented on line 4

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!