fork download
  1. #include <stdio.h>
  2.  
  3. #define C_LANG 'C'
  4. #define B_LANG 'B'
  5. #define NO_ERROR 0
  6.  
  7. int main(void)
  8. {
  9. #if C_LANG == 'C' && B_LANG == 'B'
  10. #undef C_LANG
  11. #define C_LANG "I know the C language.\n"
  12. #undef B_LANG
  13. #define B_LANG "I know BASIC.\n"
  14. printf("%s%s", C_LANG, B_LANG);
  15. #elif C_LANG == 'C'
  16. #undef C_LANG
  17. #define C_LANG "I only know C language.\n"
  18. printf("%s", C_LANG);
  19. #elif B_LANG == 'B'
  20. #undef B_LANG
  21. #define B_LANG "I only know BASIC.\n"
  22. printf("%s", B_LANG);
  23. #else
  24. printf("I don't know C or BASIC.\n");
  25. #endif
  26.  
  27. return NO_ERROR;
  28. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:15:10: error: token ""I know the C language.\n"" is not valid in preprocessor expressions
prog.c:19:10: error: token ""I know BASIC.\n"" is not valid in preprocessor expressions
stdout
Standard output is empty