Programming in C, autumn 2009
Exercise 3
MON Sep. 28 12:15-14:00 CK111
#define MAX(x,y) x < y ? y : xShow the fully expanded form of the following expressions and calculate the values of these expressions:
1 + MAX(2,3) 1 + MAX(3,2) MAX(2,3) + 1 MAX(3,2) + 1Write a macro ISLOWER(c) which gives 1, if c is a lowercase character, and 0 otherwise.
x= 1 while ( x <= 10); x++; }
for (y = .1; y!=1.0; y += .1) printf( "%f\n", y);
switch (n) { case 1: printf( "The number is 1\n"); case 2: printf( "The number is 2\n"); break; default: printf( "The number is not 1 or 2\n"); break; }
n = 1; while (n < 10) printf( "%d ", n++);
1 1 1 2 1 1 3 3 1 1 4 6 4 1Write also a main program, which you can use to test the function.