Hi, I am currently a student in web development and have to do some c programming. I am having trouble with a homework problem and would appreciate any help.
I have to write a program that defines and uses macro MINIMUM2 to determine the smallest of two numeric values. Input the values from the keyboard.
What I have so far isn't working, I have the macro defined as:
<code>
#define MINIMUM2( x, y ) ( if ( x < y )\
small = x;\
else if\
X > y\
small = y;\
else\
printf( "x and y are equal\n" ); )
</code>
I get errors when trying to compile the program. My book says to put \ at the end of a line when the replacement text continues on the next line. But it isn't working.
thanks for any help