Preprocessors
- What will be the output of the following C code?
#include <stdio.h>
#define Winter
int main()
{
#ifdef Winter
printf("Winter\t");
#undef Winter
#endif
#ifdef Winter
printf("Summer\t");
#endif
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Winter
- The “else if” in conditional inclusion is written by?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
#elif
- What will be the output of the following C code?
#include <stdio.h>
#define Cprogram
int main()
{
int p = 21;
#ifdef Cprogram
p = 11;
printf("%d", Cprogram);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Compilation Error
main.c: In function ‘main’:
main.c:8:30: error: expected expression before ‘)’ token
printf("%d", Cprogram);
^
main.c: At top level:
main.c:6:0: error: unterminated #ifdef
#ifdef Cprogram
- What will be the output of the following C code?
#include <stdio.h>
#define system 25
int main()
{
int n = 25;
#if system == n
printf("Interview ");
#endif
#if system == 25
printf("Mania\n");
#endif
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Mania
- What will be the output of the following C code?
#include <stdio.h>
#define MINIMUM 21);
#ifdef MINIMUM
#define MAXIMUM 210
#endif
int main()
{
printf("%d %d\n", MAXIMUM, MINIMUM
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
210 21