Give the output on the screen of the following program
#include <stdio.h>
#define PR(x) printf(#x " = %.8g\t",(double)x)
#define NL putchar('\n');
#define PRINT1(a) PR(a);NL
#define PRINT2(a,b) PR(a);PR(b);NL
int main()
{
double d = 3.2 , x;
int i = 2 , y;
x = (y = d/i)*2; PRINT2(x,y);
y = (x = d/i)*2; PRINT2(x,y);
y = d * (x=2.5/d); PRINT1(y);
x = d * (y = ((int) 2.9 +1.1)/d); PRINT2(x,y);
return 0;
}
Difficulty level

This exercise is mostly suitable for students
x = 2 y = 1
x = 1.6 y = 3
y = 2
x = 0 y = 0
Back to the list of exercises
Looking for a more challenging exercise, try this one !!
