Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

C | Input and Output | Question 11

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Predict the output of following program?




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

(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
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads