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 253hard
What will be the output of the following C code if following commands are used to run (considering myfile exists)?
gcc -otest test.c
./test > myfile
#include <stdio.h>
int main(int argc, char **argv)
{
char c = 'd';
putchar(c);
printf(" %d\n", argc);
}Question 254medium
What will be the output of the following C code?
scanf(“ %d %d %d”,&n1,&n2);Question 255hard
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int i = 10, j = 2;
printf("%d\n", printf("%d %d ", i, j));
}Advertisement
Question 256medium
A fatal error will be generated if the format string is ended with a white space character.
Question 257easy
Which of the following mode argument is used to truncate?
Question 258hard
What will be the output of the following C code?
#include <stdio.h>
#include <stdarg.h>
int f(char c, ...);
int main()
{
char c = 97, d = 98;
f(c, d);
return 0;
}
int f(char c, ...)
{
va_list li;
va_start(li, c);
char d = va_arg(li, char);
printf("%c\n", d);
va_end(li);
}Advertisement
Question 259medium
What does the following command line signify?
prog1|prog2Question 260easy
Which function has a return type as char pointer?
Question 261medium
The following C expression can be substituted for?
if (isalpha(c) && isdigit(c))