Skip to content
Related Articles

Related Articles

C | Input and Output | Question 4
  • Difficulty Level : Easy
  • Last Updated : 09 Jan, 2013




#include <stdio.h>
// Assume base address of "GeeksQuiz" to be 1000
int main()
{
   printf(5 + "GeeksQuiz");
   return 0;
}

(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.

Want to learn from the best curated videos and practice problems, check out the C Foundation Course for Basic to Advanced C.
My Personal Notes arrow_drop_up
Recommended Articles
Page :