I scribble some typical C codes here which I find usually while programming. Blog comprises of C programming questionnaires where you have to identify the output, identical to questions asked in interviews. Any corrections or suggestions are welcomed.
Note: Some questions may lack explanation, in such case apt explanations are invited & welcomed!
Monday, August 8, 2011
Numero Uno!
#include <stdio.h>
void main()
{
int x=1;
printf("%d\n",x);
#define x 20
printf("%d\n",x);
}
Output:
1
20
ConCepT: During preprocessing all the occurrence of x after #define directive is replaced by 20.
No comments:
Post a Comment