I like Why06's idea of the 'error of the day' so I figured i'd post some of the questions I have asked people while interviewing them for C++ Software Developer Positions.
These questions are usually written on a whiteboard (or printed out) and thus are meant to be answered WITHOUT the help of a compiler in an interview! So just read the code, don't copy/paste/build/run and just figure out what it does by reading.
I suggest you answer in a 'white font' so that others don't immediately see your answers
IQOD #1:
Consider the following program snippet:
Code:
#define ABC 20
#define XYZ 10
#define XXX ABC-XYZ
void main()
{
int a;
a = XXX * 10;
printf("%d\n",a);
}
Question: What output is generated / is the value of 'a'?