Predict the output of following program?
#include <stdio.h> int main(void) { int x = printf("GeeksQuiz"); printf("%d", x); return 0; } |
chevron_right
filter_none
(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
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 8
- C | Input and Output | Question 3
- C | Input and Output | Question 4
- C | Input and Output | Question 5
- C | Input and Output | Question 13
- C | Input and Output | Question 9
- C | Input and Output | Question 13
- C | Input and Output | Question 2
- C | Input and Output | Question 13
- C | Input and Output | Question 13
- C | Input and Output | Question 6
- C | Input and Output | Question 12
- 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)
- How to change the output of printf() in main() ?
- Output of C programs | Set 30 (Switch Case)
- Code valid in both C and C++ but produce different output

