Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// This is the error message i get when i compile the code I need help, I am almost done with this assignment, however, i

image text in transcribed

image text in transcribed

image text in transcribed

// This is the error message i get when i compile the code

image text in transcribed

I need help, I am almost done with this assignment, however, i still get errors when i compiled in GCC. The expected output and specifications are posted above. I need help :(

// Code I have worked on

#include

#define addm(A, B) (A + B)

#define cubem(x) (x*x*x)

#define minm(a, b) (((a)

#define evenm(n) ((n%2 == 0) ? 1 : 0)

int subf(int a, int b)

{

return a - b;

}

int cubef(int a)

{

return a * a * a;

}

int minf(int a, int b)

{

if (a

{

return a;

}

else

{

return b;

}

}

int oddf(int a)

{

if(a % 2 == 1)

{

return 1;

}

else

{

return 0;

}

}

int main()

{

int a = 3, b = 6;

subf(a, b);

printf("subf(a, b) = %d " , subf(a, b));

subm(a, b);

printf("subm(a, b) = %d " , subm(a, b));

subf(a++, b--);

printf("subf(a++, b--) = %d " , subf(a++, b--));

a = 6, b = 8;

subm(a++, b--);

printf("subm(a++, b--) = %d " , subm(a++, b--));

a = 6, b = 8;

cubef(a);

printf("cubef(a) = %d " , cubef(a));

cubem(a);

printf("cubem(a) = %d " , cubem(a));

cubef(--a);

printf("cubef(--a) = %d " , cubef(--a));

a = 3, b = 6;

cubem(--a);

printf("cubem(--a) = %d " , cubem(--a));

a = 3, b = 6;

minf(a, b);

printf("minf(a, b) = %d " , minf(a, b));

minm(a, b);

printf("minm(a, b) = %d " , minm(a, b));

minf(--a, --b);

printf("minf(--a, --b) = %d " , minf(--a, --b));

a = 3, b = 6;

minm(--a, --b);

printf("minm(--a, --b) = %d " , minm(--a, --b));

a = 2, b = 6;

oddf(a);

printf("oddf(a) = %d " , oddf(a));

oddm(a);

printf("oddm(a) = %d " , oddm(a));

a = 6, b = 8;

oddm(a++);

printf("oddm(a++) = %d " , oddm(a++));

return 0;

}

int subf(int a, int b) { return a - b; int cubef(int a) { return a * a * a; int minf(int a, int b) { if (a

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

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

7. Discuss the key features of the learning organization.

Answered: 1 week ago