ProgrammingHardWipro · Accenture · Capgemini pattern

What is the output of this C program (assume a typical 64-bit platform: int 32 bits, long and pointers 64 bits, double 8 bytes, structs aligned to their widest member with no packing pragma)? #include <stdio.h> int main(void) { #define PI 3 #define AREA(r) (PI * (r) * (r)) printf("%d", AREA(4)); return 0; }

  1. A. 16
  2. B. 36
  3. C. 12
  4. D. 48

Correct answer: D. 48

PI is textually replaced by 3; AREA(4) expands to (3 * (4) * (4)) = 48.

More C Programming questions

Exams that ask this topic