Home / MCQ Bank / Computer
Computer File Input Output

What will be the output of the following C code if 2 characters is typed by the user? #include <stdio.h> #include <string.h> int main() { char line[3]; fgets(line, 3, stdin); printf("%d\n", line[2]); return 0; }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C

Related Computer Questions

__________ prevents the page from being indexed altogether. When is the finally block executed? In Powerpoint 2016, 'Rehearse Timings' option is available in:_________? What is the speciality about the inorder traversal of a binary search tree? What will be the output of the following C++ code? #include <stdio.h> #include<iostream> using namespace std; int array1[] = {1200, 200, 2300, 1230, 1543}; int array2[] = {12, 14, 16, 18, 20}; int temp, result = 0; int main() { for (temp = 0; temp < 5; temp++) { result += array1[temp]; } for (temp = 0; temp < 4; temp++) { result += array2[temp]; } cout << result; return 0; }