The Wayback Machine - https://web.archive.org/web/20231214204424/https://www.geeksforgeeks.org/c-input-and-output-question-4/
Open In App
Related Articles

C | Input and Output | Question 4

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

C




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


Quiz of this Question
Please comment below if you find anything wrong in the above post

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 09 Jan, 2013
Like Article
Save Article
Previous
Next
Similar Reads