Question: // Part 2: // We want to pass incremented values of x and y to the macro and function to compare their outputs in VS

 // Part 2: // We want to pass incremented values of

// Part 2: // We want to pass incremented values of x and y to the macro and function to compare their outputs in VS and GCC. // Run this program in Visual Studio(VS) and then again in GCC. Fill the blanks below with the output values for polyFunc and polyMacro. // Then correct/edit this function so that polyFunc and polyMacro produce same correct output of 36. // (5 points) // void part2(int x, int y) { int x_copy = x, y_copy = y;

printf(" polyFunc(x, y) = %d polyMacro(x, y) = %d ", polyFunc(++x, ++y), polyMacro(++x_copy, ++y_copy));

// Replace the 4 blank spaces below with the actual output observed when running the code in VS and GCC. // The blanks should have the answers of unedited program. Keep the answers in blanks as they were, after editing the program. printf("In VS : the result of polyFunc = __ and polyMacro = __ "); // (5 points) printf("In GCC: the result of polyFunc = __ and polyMacro = __ "); // (5 points)

// Explain in a short sentence why VS and GCC could possibly produce a different value for the same program and for the same input. printf("Explanation: _____ "); // (2.5 points) }

// Part 2: | // We want to pass incremented values of x and y to the macro and function to compare their outputs in Vs and GCC. // Run this program in Visual Studio(VS) and then again in GCC. Fill the blanks below with the output values for polyFunc and polyMacro. // Then correct/edit this function so that polyFunc and polyMacro produce same correct output of 36. // (5 points) void part2(int x, int y) { int x_copy = x, y_copy = y; printf(" polyFunc(x, y) = %d polyMacro(x, y) = %d ", polyFunc(++x, ++y), polyMacro(++x_copy, ++y_copy)); // Replace the 4 blank spaces below with the actual output observed when running the code in Vs and GCC. // The blanks should have the answers of unedited program. Keep the answers in blanks as they were, after editing the program. printf("In vs : the result of polyFunc = __ and polyMacro = _ "); 7 (5 points) printf("In GCC: the result of polyFunc = __ and polyMacro = __ "); // (5 points) // Explain in a short sentence why Vs and GCC could possibly produce a different value for the same program and for the same input. printf("Explanation: ___in "); // (2.5 points)

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!