Programming in C, autumn 2010
Exercise 3
THU Sep. 23 9:15-12:00 B119 summary lecture and exercises
#define MIN(x,y) x < y ? x : yShow the fully expanded form of the following expressions and calculate the values of these expressions:
1 + MIN(2,3) 1 + MIN(3,2) MIN(2,3) + 1 MIN(3,2) + 1Write a macro MED(a,b,c), which prints 1 if the value of b is between a and c; otherwise it prints 0. Assume a, b, c are integers.
1.2 3.4 6 2.4 5 9the output file would contain:
1.2 2.4 3.4 5 6 9Use conditional compiling and change the program so that in a debugging mode, the program displays a message informing the user as from which input file is being read, if the reading is not successful.