C | Input and Output | Question 13
Predict the output of following program?
#include "stdio.h" int main() { char arr[100]; printf("%d", scanf("%s", arr)); /* Suppose that input value given for above scanf is "GeeksQuiz" */ return 1; } |
chevron_right
filter_none
(A) 9
(B) 1
(C) 10
(D) 100
Answer: (B)
Explanation: In C, scanf returns the no. of inputs it has successfully read. See https://www.geeksforgeeks.org/archives/674
Quiz of this Question
Thank You for reading the Post !
Recommended Posts:
- C | Input and Output | Question 4
- C | Input and Output | Question 13
- C | Input and Output | Question 6
- C | Input and Output | Question 9
- C | Input and Output | Question 5
- C | Input and Output | Question 13
- C | Input and Output | Question 3
- C | Input and Output | Question 13
- C | Input and Output | Question 12
- C | Input and Output | Question 2
- C | Input and Output | Question 8
- C | Input and Output | Question 11
- Basic Input and Output in C
- Input-output system calls in C | Create, Open, Close, Read, Write
- Output of C programs | Set 63



