Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #pragma warning(disable : 4996) // needed in VS // CSE 240 Spring 2021 Homework 2 Question 3 (25 points) // Note: You may notice

#include #pragma warning(disable : 4996) // needed in VS

// 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) }

int main() { int x = 5, y = 1;

printf("Part 1: "); part1(x);

while (1); // needed to keep console open in VS return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions