Question: #include #pragma warning disable : 4996) // needed in VS 2 // CSE 248 Spring 2020 Homework 2 Question 3 (25 points) 11/ Note: You

#include #pragma warning disable : 4996) // needed in VS 2 // CSE 248 Spring 2020 Homework 2 Question 3 (25 points) 11/ Note: You may notice some warnings when you compile in GCC or VS, that is okay. 5 6 7 #define ispositive(x) ((x > @) ?x: ) #define polyMacro(a, b) (a*a + $*a- 3*a*b + b*b) 11 Pink polyFunc(int it, int b) return (aka 18*a 3*.*h bb); 16 1/ // Part 1: // We want to pass the value of 10 to ispositive and expect the result of ispositive to be 10, why is the result 11? Correct the error (5 points) void parti(int x) { int result; result - ispositive (1 x); printf("isPositive(10) = %d ", result); // why did this error occur? Please provide the answer in your own words below. printf("Explanation: _ "); // (2.5 points) 30 31 // 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 76. // (5 points) 32 1/1 void part(int x, int y){ inl x_copy - x, y_copy - y; printf(" polyfunc(x, y) - Xd polyMacro(x, y) - Xd ", 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 - _ n"); // (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) 48 // Do not edit main() Sint main() inl x-9, y - 5; NRRN362 printf("Part 1: "); parti(x); printf("Part 2: "); part2(x, y); // needed to keep console open in VS while (1); return ; #include #pragma warning disable : 4996) // needed in VS 2 // CSE 248 Spring 2020 Homework 2 Question 3 (25 points) 11/ Note: You may notice some warnings when you compile in GCC or VS, that is okay. 5 6 7 #define ispositive(x) ((x > @) ?x: ) #define polyMacro(a, b) (a*a + $*a- 3*a*b + b*b) 11 Pink polyFunc(int it, int b) return (aka 18*a 3*.*h bb); 16 1/ // Part 1: // We want to pass the value of 10 to ispositive and expect the result of ispositive to be 10, why is the result 11? Correct the error (5 points) void parti(int x) { int result; result - ispositive (1 x); printf("isPositive(10) = %d ", result); // why did this error occur? Please provide the answer in your own words below. printf("Explanation: _ "); // (2.5 points) 30 31 // 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 76. // (5 points) 32 1/1 void part(int x, int y){ inl x_copy - x, y_copy - y; printf(" polyfunc(x, y) - Xd polyMacro(x, y) - Xd ", 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 - _ n"); // (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) 48 // Do not edit main() Sint main() inl x-9, y - 5; NRRN362 printf("Part 1: "); parti(x); printf("Part 2: "); part2(x, y); // needed to keep console open in VS while (1); return