Programming in C, autumn 2007
Exercise 3
FRI Sep. 21 12:15-14:00 BK106
#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++);
x x x x x x x x x x x x x x x x x x x x x x x x x