a) Ken Thompson b) Bjarne Stroustrup c) Dennis Ritchie d) Brian Kernighan Answer: b Explanation: Bjarne ...
View QuestionThe #elif directive cannot appear after the preprocessor #else directive.
a) true b) false Answer: a
View QuestionConditional inclusion can be used for ___________
a) Preventing multiple declarations of a variable b) Check for existence of a variable and doing ...
View QuestionIn a conditional inclusion, if the condition that comes after the if is true, then what will happen during compilation?
a) Then the code up to the following #else or #elif or #endif is compiled b) Then the ...
View Question
What will be the output of the following C code?
#include < stdio.h >
#define COLD
int main()
{
#ifdef COLD
printf(“COLD\t”);
#undef COLD
#endif
#ifdef COLD
printf(“HOT\t”);
#endif
}
What will be the output of the following C code? #include < stdio.h >
View QuestionThe “else if” in conditional inclusion is written by?
a) #else if b) #elseif c) #elsif d) #elif Answer: d
View Question
What will be the output of the following C code?
#include < stdio.h >
#define SYSTEM 20
int main()
{
int a = 20;
#if SYSTEM == a
printf(“HELLO “);
#endif
#if SYSTEM == 20
printf(“WORLD\n”);
#endif
}
What will be the output of the following C code? #include < stdio.h >
View QuestionWhat is the advantage of #define over const?
a) Data type is flexible b) Can have a pointer c) Reduction in the size of the program d) None ...
View Question
What will be the output of the following C code?
#include < stdio.h >
int foo(int, int);
#define foo(x, y) x / y + x
int main()
{
int i = -6, j = 3;
printf(“%d “,foo(i + j, 3));
#undef foo
printf(“%d\n”,foo(i + j, 3));
}
int foo(int x, int y)
{
return x / y + x;
}
What will be the output of the following C code? #include < stdio.h > ...
View Question
What will be the output of the following C code?
#include < stdio.h >
#define foo(x, y) x / y + x
int main()
{
int i = -6, j = 3;
printf(“%d “, foo(i + j, 3));
printf(“%d\n”, foo(-3, 3));
return 0;
}
What will be the output of the following C code? #include < stdio.h >
View Question