Question: #include #pragma warning(disable : 4996) // needed in VS // CSE 240 Spring 2021 Homework 2 Question 3 (25 points) // Note: You may notice
#include
// CSE 240 Spring 2021 Homework 2 Question 3 (25 points) // Note: You may notice some warnings when you compile in GCC or VS, that is okay.
#define ABS(x) (((x) < 0) ? -(x) : (x))
#define polyMacro(a, b) (a*a + 5*a- 4*a*b + b*b)
int polyFunc(int a, int b) { return (a * a + 5 * a - 4 * a * b + b * b); }
// Part 1: // We want to pass the value of 6 to ABS and expect the result of ABS to be 6, why is the result 7? Correct the error (5 points) void part1(int x) {
int result; result = ABS(++x);
printf("absm(6) = %d ", result);
// Why did this error occur? Please provide the answer in your own words below. printf("Explanation: ________ "); // (2.5 points) }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
