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

10/15

Page

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

What will be the output of the following C code?
#include <stdio.h>
int main()
{
    char *str = "hello, world";
    char str1[15] = "hello wo 9";
    strcpy(str, str1);
    printf("%s", str1);
}

Select an option to see the answer and solution.

What is the return value of getc()?

Select an option to see the answer and solution.

What does the C statement given below says?
scanf("%7s",ch);

Select an option to see the answer and solution.

What action is carried out by scanf if a user enters any blank spaces, tabs, and newlines?

Select an option to see the answer and solution.

Which of the following will return a non-zero value when checked with isspace(c)?

Select an option to see the answer and solution.

Which is the correct way to generate numbers between minimum and maximum(inclusive)?

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[10] = "hello";
    char *str1 = "world";
    strncat(str, str1, 9);
    printf("%s", str);
}

Select an option to see the answer and solution.

What will be the value of var for the following C statement?
var = strcmp("Hello", "World");

Select an option to see the answer and solution.

If by mistake you specify more number of arguments, the excess arguments will . . . . . . . .

Select an option to see the answer and solution.

What is the purpose of va_end?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
#include <ctype.h>
int main()
{
    char c = 't';
    printf("%d\n", isspace(c));
}

Select an option to see the answer and solution.

stderr is similar to?

Select an option to see the answer and solution.

stderr is similar to?

Select an option to see the answer and solution.

What error is generated on placing an address operator with a variable in the printf statement?

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 = 2;
    printf("%d\n", printf("%d %d ", i, j));
}

Select an option to see the answer and solution.

What will sin(x) returns?

Select an option to see the answer and solution.

what is the function of fputs()?

Select an option to see the answer and solution.

What will be the output of the following C code?
#include <stdio.h>
#include <ctype.h>
int main()
{
    int i = 9;
    if (isdigit(i))
        printf("digit\n");
    else
        printf("not digit\n");
        return 0;
}

Select an option to see the answer and solution.

rand() and srand() functions are used . . . . . . . .

Select an option to see the answer and solution.

. . . . . . . . is used to define the type and the interpretation of the value of the corresponding argument.

Select an option to see the answer and solution.