C Puzzles
C Puzzles
Questions
L1.Q1 : Write the output of the following program
#include #define ABC #define XYZ #define XXX void main() { int 20 10 ABC - XYZ
a;
a = XXX * 10; }
Solution
printf("%d\n", a);
for L1.Q1
Solution for L1.Q2 L1.Q3 : What will be output of the following program ?
#include void main() { int cnt = 5, a; do { a /= cnt; } while (cnt --); printf ("%d\n", a);
int
a = 5;
Answers
L1.A1 Solution for L1.Q1
a = xxx * 10 which is => a = ABC - XYZ * 10 => a = 20 - 10 * 10 => a = 20 - 100 => a = -80