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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started