Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions