#include <stdio.h> // Assume base address of "GeeksQuiz" to be 1000 int main() { printf(5 + "GeeksQuiz"); return 0; } |
chevron_right
filter_none
(A) GeeksQuiz
(B) Quiz
(C) 1005
(D) Compile-time error
Answer: (B)
Explanation:
printf is a library function defined under stdio.h header file. The compiler adds 5 to the base address of the string through the expression 5 + “GeeksQuiz” . Then the string “Quiz” gets passed to the standard library function as an argument.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
Recommended Posts:
- C | Input and Output | Question 13
- C | Input and Output | Question 12
- C | Input and Output | Question 9
- C | Input and Output | Question 8
- C | Input and Output | Question 11
- C | Input and Output | Question 13
- C | Input and Output | Question 13
- C | Input and Output | Question 6
- C | Input and Output | Question 3
- C | Input and Output | Question 5
- C | Input and Output | Question 13
- C | Input and Output | Question 2
- Basic Input and Output in C
- Input-output system calls in C | Create, Open, Close, Read, Write
- Output of C Program | Set 29
- Output of C programs | Set 63
- Output of C programs | Set 64 (Pointers)
- Code valid in both C and C++ but produce different output
- How to change the output of printf() in main() ?
- Output of C programs | Set 30 (Switch Case)

