C/C MCQ Quiz Hub

C Programming - MCQ Questions Set 4

Choose a topic to test your knowledge and improve your C/C skills

Presence of code like “s.t.b = 10” indicates ____





✅ Correct Answer: 2

Which of the following uses structure?





✅ Correct Answer: 4

What is the correct syntax to declare a function foo() which receives an array of structure in function?





✅ Correct Answer: 1

Presence of loop in a linked list can be tested by ________





✅ Correct Answer: 2

Which option should be selected to work the following C expression? string p = "HELLO";





✅ Correct Answer: 2

Which of the given option is the correct method for initialization? typedef char *string;





✅ Correct Answer: 2

Which of the following is false about typedef?





✅ Correct Answer: 2

Which of the following may create problem in the typedef program?





✅ Correct Answer: 4

 typedef int (*PFI)(char *, char *)creates _________





✅ Correct Answer: 1

What is typedef declaration?





✅ Correct Answer: 3

The size of a union is determined by the size of the ______





✅ Correct Answer: 3

Members of a union are accessed as______





✅ Correct Answer: 3

Which of the following data types are accepted while declaring bit-fields?





✅ Correct Answer: 1

Which of the following reduces the size of a structure?





✅ Correct Answer: 2

Which of the following is not allowed?





✅ Correct Answer: 4

Bit fields can only be declared as part of a structure.





✅ Correct Answer: 2

Which among the following is the odd one out?





✅ Correct Answer: 4

 For a typical program, the input is taken using _________





✅ Correct Answer: 4

What does the following command line signify? prog1|prog2





✅ Correct Answer: 3

What is the default return-type of getchar()?





✅ Correct Answer: 2

What is the value of EOF?





✅ Correct Answer: 1

What is the use of getchar()?





✅ Correct Answer: 3

Which of the following statement is true?





✅ Correct Answer: 3

What is the return value of putchar()?





✅ Correct Answer: 4

Which is true about function tolower?





✅ Correct Answer: 4

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





✅ Correct Answer: 2

The statement prog < infile causes _____





✅ Correct Answer: 1

What is the difference between %e and %g?





✅ Correct Answer: 2

Escape sequences are prefixed with ____





✅ Correct Answer: 4

What is the purpose of sprintf?





✅ Correct Answer: 2

The syntax to print a % using printf statement can be done by ____





✅ Correct Answer: 4

Which of the following function with ellipsis are illegal?





✅ Correct Answer: 1

Which of the following data-types are promoted when used as a parameter for an ellipsis?





✅ Correct Answer: 1

Which header file includes a function for variable number of arguments?





✅ Correct Answer: 2

Which of the following macro extracts an argument from the variable argument list (ie ellipsis) and advance the pointer to the next argument?





✅ Correct Answer: 2

 The type va_list in an argument list is used _____





✅ Correct Answer: 1

In a variable length argument function, the declaration “…” can _____





✅ Correct Answer: 2

Each call of va_arg ____





✅ Correct Answer: 3

What are the first and second arguments of fopen?





✅ Correct Answer: 1

For binary files, a ___ must be appended to the mode string.





✅ Correct Answer: 2

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





✅ Correct Answer: 3

What is the return value of getc()?





✅ Correct Answer: 2

When a C program is started, O.S environment is responsible for opening file and providing pointer for that file?





✅ Correct Answer: 4

In C language, FILE is of which data type?





✅ Correct Answer: 3

What is meant by ‘a’ in the following C operation? fp = fopen("Random.txt", "a");





✅ Correct Answer: 2

Which of the following mode argument is used to truncate?





✅ Correct Answer: 3

Which type of files can’t be opened using fopen()?





✅ Correct Answer: 4

Which of the following fopen() statements are illegal?





✅ Correct Answer: 4

What does the following segment of C code do? fprintf(fp, "Copying!");





✅ Correct Answer: 1

What is FILE reserved word?





✅ Correct Answer: 4