Consider the following: - I) LINE - II) TIME - III) FILE - IV) DATE - V) STDC Which of the...
Qualcomm technical mcq question, verified with a worked answer. Free to practise - no sign-up.
Consider the following:
- I) LINE
- II) TIME
- III) FILE
- IV) DATE
- V) STDC
Which of the following is true?
Show answer & explanation
Answer: B. All are predefined macros in C
All five are standard predefined macros in C: LINE (current line number), TIME (compilation time), FILE (source filename), DATE (compilation date), and STDC (indicates C89/C99 compliance). These are defined by the preprocessor and available in all C implementations.
Step-by-step Derivation:
Verify each macro:
- LINE: Predefined ✓ (expands to current line number in source file)
- TIME: Predefined ✓ (expands to compilation time in "HH:MM:SS" format)
- FILE: Predefined ✓ (expands to current source filename as a string)
- DATE: Predefined ✓ (expands to compilation date in "Mmm DD YYYY" format)
- STDC: Predefined ✓ (defined as 1 for C89/C99 compliant compilers)
All five are standard C preprocessor macros → Answer is B.