II-264 Programming Concepts
(a) Address (b) Value
(c) Error message (d) None of the above
31. What is the output of the following program?
#include <stdio.h>
#include <conio.h>
void main()
{
int x=2,*p=5;
p=&x;
#define P &p
clrscr();
printf(" %d",**P);
}
(a) 2 (b) 5
(c) 65500 (d) None of the above
Answers
1. (a) 2. (a) 3. (a) 4. (d) 5. (a) 6. (a) 7. (b) 8. (a) 9. (b) 10. (c)
11. (b) 12. (b) 13. (b) 14. (b) 15. (a) 16. (a) 17. (a) 18. (b) 19. (a) 20. (b)
21. (a) 22. (a) 23. (b) 24. (d) 25. (a) 26 (a) 27. (a) 28. (a) 29. (a) 30. (a)
31. (a)
True or False
1. The pre-processor is executed before the actual compilation of program code begins.
2. The program typed in the editor is source code for the pre-processor.
3. The #define defines the macro templates.
4. The macro definition must be terminated by semi-colon.
5. The define is a keyword.
6. The #undef undefines the macro.
7. The #include loads the specified file.
8. #include "stdio.h" the compiler searches the file in entire system.
9. #include <stdio.h> the compiler searches the file in standard directory.
10. Conditional compilation means few statements can be skipped from compiler.
11. The #ifdef and #ifndef work exactly the same way.
12. The #error flags are user-defined messages.
M12_ITL-ESL4791_02_SE_C12.indd 264 12/22/2012 5:05:49 PM