#include
#define a 10
int main()
{
printf("%d ",a);
#define a 50
printf("%d ",a);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
What is the output of this program?
#include
int main()
{
printf("%d",30);
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
In a macro call the control is passed to the macro.
Answer: B
False, Always the macro is substituted by the given text/expression.
Enter details here
Will the following program print the message infinite number of times?
#include
#define INFINITELOOP while(1)
int main()
{
INFINITELOOP
printf("IndiaBIX");
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
What will be the output of the program?
#include
#define FUN(i, j) i##j
int main()
{
int va1=10;
int va12=20;
printf("%d\n", FUN(va1, 2));
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
Preprocessor directive #ifdef .. #else ... #endif is used for conditional compilation.
Answer: A
No answer description available for this question.
Enter details here
A preprocessor directive is a message from compiler to a linker.
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the following C code?
#include
#define hello
main()
{
#ifdef hello
#define hi 4
#else
#define hi 5
#endif
printf("%d",hi);
}
Answer: A
The code shown above illustrates #define, #ifdef, #else, #endif. Since the identifier hello is defined (condition of #if is true), another identifier names hi is defined and it’s value is 4. If hello was not defined, then the value of hi would be 5.
Enter details here
In which stage the following code
#include
gets replaced by the contents of the file stdio.h
Answer: D
The preprocessor replaces the line #include
Enter details here
What will be the output of the following C code?
#include
#define hello 10
void main()
{
printf("%d",hello);
#undef hello
printf("%d",hello);
}
Answer: C
No answer description available for this question.
Enter details here