File Input Output MCQs
Practice free File Input Output multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 296 questions — no login required.
Question 226hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
char n[] = "hello\nworld!";
char s[13];
sscanf(n, "%s", s);
printf("%s\n", s);
return 0;
}Question 227hard
What will be the output of the following C code?
#include <stdio.h>
#include <ctype.h>
int main()
{
int i = 32;
if (isspace(i))
printf("space\n");
else
printf("not space\n");
return 0;
}Question 228hard
What will be the output of the following C code?
#include <stdio.h>
#include <stdarg.h>
int f(int c, ...);
int main()
{
int c = 97;
float d = 98;
f(c, d);
return 0;
}
int f(int c, ...)
{
va_list li;
va_start(li, c);
float d = va_arg(li, float);
printf("%f\n", d);
va_end(li);
}Advertisement
Question 229medium
The functions vprintf(), vfprintf(), and vsprintf() are not equivalent to the corresponding printf() functions except the variable argument list.
Question 230hard
Which is true about isalnum(c), where c is an int that can be represented as an unsigned?
char or EOF.isalnum(c) returnsQuestion 231medium
Which of the following is used during memory deallocation in C?
Advertisement
Question 232easy
What is the difference in the ASCII value of capital and non-capital of the same letter is?
Question 233hard
In the following C program, every time program is run different numbers are generated.
#include <stdio.h>
int main()
{
srand(time(NULL));
printf("%d\n", rand());
return 0;
}Question 234hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int i = 10, j = 3, k = 3;
printf("%d %d ", i, j, k);
}