Question: Consider the code below: void myFunction(int x){ x=5 } int main(int argc, char const * argv[]){ int y=8 myFunction (y); printf(%d, y); return 0 ;

Consider the code below: void myFunction(int x){ x=5 \} int main(int argc, char const * argv[]){ int y=8 myFunction (y); printf("\%d", y); return 0 ; \} What it will print as an output? 5 because x and y are the same buckets in the memory despite of having different names. 8 because x and y have different names despite of being the same bucket in the memory. 8 because x and y are different buckets in the memory. When myFunction is called, a copy of the value in y is attributed to x, which then change but doesn't affect the original y. 5 because x and y are the same bucket in the memory. When myFunction is called, the value of y and x are the same, so every change in x will directly affect y
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
