Question
// This is the error message i get when i compile the code I need help, I am almost done with this assignment, however, i
// This is the error message i get when i compile the code
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 (aStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started