C | Input and Output | Question 11

Predict the output of following program?

filter_none

edit
close

play_arrow

link
brightness_4
code

#include <stdio.h>
int main(void
{
   int x = printf("GeeksQuiz");
   printf("%d", x);
   return 0;
}

chevron_right


(A) GeeksQuiz9
(B) GeeksQuiz10
(C) GeeksQuizGeeksQuiz
(D) GeeksQuiz1


Answer: (A)

Explanation: The printf function returns the number of characters successfully printed on the screen. The string “GeeksQuiz” has 9 characters, so the first printf prints GeeksQuiz and returns 9.

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.