Vidyalelo
C Programming · all questions

File Input Output
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

296

Questions

14/15

Page

Pick an option on a question to see the right answer and solution.

The following C expression can be substituted for?
if (isalpha(c) && isdigit(c))

Select an option to see the answer and solution.

What will the given code result is
printf("\n you are\"awesome \" ");

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char *str = "hello, world\n";
    printf("%d", strlen(str));

}

Select an option to see the answer and solution.

Which is not true about function tolower?

Select an option to see the answer and solution.

putchar(c) function/macro always outputs character c to the . . . . . . . .

Select an option to see the answer and solution.

What is the meaning of the following C statement?
scanf("%[^\n]s", ch);

Select an option to see the answer and solution.

What is the return type of rand() function?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    FILE *fp = stdout;
    int n;
    fprintf(fp, "%d ", 45);
    fprintf(stderr, "%d ", 65);
    return 0;
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    printf("%d\n", srand(9000));
    return 0;
}

Select an option to see the answer and solution.

What are the Properties of the first argument of a printf() functions?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    short int i;
    scanf("%hd", &i);
    printf("%hd", i);
    return 0;
}

Select an option to see the answer and solution.

fflush(NULL) flushes all . . . . . . . .

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    FILE *fp = stdout;
    int n;
    fprintf(fp, "%d\n ", 45);
    fprintf(stderr, "%d ", 65);
    return 0;
}

Select an option to see the answer and solution.

What will fopen will return, if there is any error while opening a file?

Select an option to see the answer and solution.

Which of the following is the right declaration for fgets() inside the library?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    int i = 10, j = 3;
    printf("%d %d %d", i, j);
}

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char *n;
    scanf("%s", n);
    return 0;
}

Select an option to see the answer and solution.

Which of the following fopen() statements are illegal?

Select an option to see the answer and solution.

The syntax of printf() function is printf("control string", variable list) ;what is the prototype of the control string?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    short int i;
    scanf("%*hd", &i);
    printf("%hd", i);
    return 0;
}

Select an option to see the answer and solution.