MCQ on Advanced C programming
Explore most important multiple choice Questions on advanced c programming. Here is the chapterwise MCQ for study.
Table of contents |
---|
MCQ on Preprocessors |
MCQ on pointers |
MCQ on strings |
MCQ on structure |
MCQ on advanced c features |
MCQ on file handling |
MCQ type Questions on Preprocessors in C |
---|
Q1 : What are the types of C Preprocessor Directives ?
Answer : All of the above |
Q2 : Processor Directive in C language starts with?
Answer : # |
Q3 : What is the keyword used to define a C macro ?
Answer : define |
Q4 : What is the C keyword used to create global Constants?
Answer : const |
Q5 : What does #include stdio.h in c language ?
Answer : All the above |
Q6 : #include is called
Answer : Preprocessor directive |
Q7 : The preprocessor provides the ability for _______________.
Answer : All of the mentioned |
Q8 : The purpose of the preprocessor directive #error is that ____________
Answer : It causes the preprocessor to report a fatal error |
Q9 : Which of the following is not a preprocessor directive?
Answer : #ifelse |
MCQ type questions on pointers |
---|
Q1 : The reason for using pointers in a C program is ?
Answer : All of the above |
Q2 : If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?
Answer : -> |
Q3 : A pointer is____
Answer : A variable that stores address of other variable |
Q4 : The operator used to get value at address stored in a pointer variable is___
Answer : * |
Q5 : What is wild pointer?
Answer : Pointer which is not initialized |
Q6 : Address stored in the pointer variable is of type __________.
Answer : Integer |
Q7 : In order to fetch the address of the variable we write preceding _________ sign before variable
Answer : & |
Q8 : Comment on this: const int *ptr;
Answer : You cannot change the value pointed by ptr |
Q9 : โ*โ is called as ________.
Answer : Value at operator |
MCQ questions on strings |
---|
Q1 : What is the Format specifier used to print a String or Character array in C printf or scanf function?
Answer : %s |
Q2 : What is a String in C Language?
Answer : String is an array of characters with null character as the last element of array |
Q3 : What is the maximum length of a C String?
Answer : None of the above |
Q4 : How do you accept a Multi Word Input in C Language?
Answer : gets() |
Q5 : Which function will you choose to join two words?
Answer : strcat() |
Q6 : The______ function returns the number of characters that are present before the terminating null character.
Answer : strlen() |
Q7 : Which of the following function sets first n characters of a string to a given character?
Answer : strnset() |
Q8 : If the two strings are identical, then strcmp() function returns
Answer : 0 |
Q9 : Length of the string "lets find course" is
Answer : 16 |
Q10 : The ______ character is used to indicate end of string in C programming.
Answer : '\0' |
Q11 : The string processing related functions are stored in ____________ header file.
Answer : string.h |
Q12 : ______ C string function can be used to search string into given string.
Answer : strstr() |
MCQ questions on structure |
---|
Q1 : What is a structure in C language?
Answer : All of the above |
Q2 : What is the size of a C structure?
Answer : size of c structure is the total bytes of all elements of structure. |
Q3 : Choose a correct statement about C structure elements?
Answer : structure elements are stored in contiguous memory locations. |
Q4 : What are the uses of C Structures?
Answer : All of the above |
Q5 : Choose a correct statement about C structures.
Answer : All of the above |
Q6 : Which of the following operation is illegal in structures?
Typecasting of structure. |
Q7 : The correct syntax to access the member of the its structure in the array of structures is? Assuming: struct temp { int b; } s[50];
Answer : s[i].b |
Q8 : What is the correct syntax to declare a function foo() which receives an array of structure in function?
Answer : void foo(struct *var); |
Q9 : Which of the following are themselves a collection of different data types?
Answer : Structures |
Q10 : User-defined data type can be derived by___________
Answer : All of the above |
Q11 : Which operator connects the structure name to its member name?
Answer : . |
Q12 : Which of the following cannot be a structure member?
Answer : None of the above |
MCQ questions of c advanced features |
---|
Q1 : Size of a union is determined by size of the.
Answer : Biggest member in the union |
Q2 : Members of a union are accessed as________________.
Answer : Both a & b |
Q3 : Which of the following share a similarity in syntax? 1. Union, 2. Structure, 3. Arrays and 4. Pointers
Answer : 1 and 2 |
Q4 : Bit fields can only be declared as part of a structure.
Answer : true |
Q5 : What is the similarity between a structure, union and enumeration?
Answer : All of them let you define new data types. |
Q6 : Which of the following operators can be applied on structure variables?
Answer : Assignment ( = ) |
Q7 : Which of the following reduces the size of a structure?
Answer : bit-fields |
Q8 : Bit field___
Answer : is a structure of declaring the sizes of the members in terms of bits. |
Q9 : The declaration int x : 4; means
Answer : x is four-bit integer |
File Handling |
---|
Q1 : Which of the following true about FILE *fp
Answer : FILE is a keyword in C for representing files and fp is a variable of FILE type. |
Q2 : The first and second arguments of fopen() are
Answer : A character string containing the name of the file & the second argument is the mode |
Q3 : Which type of files canโt be opened using fopen()?
Answer : None of the above |
Q4 : If there is any error while opening a file, fopen will return?
Answer : NULL |
Q5 : Select a function which is used to write a string to a fileโฆ
Answer : fputs() |
Q6 : Which function will return the current file position for stream?
Answer : ftell() |
Q7 : What is the need for a File when you can store anything in memory?
Answer : All of the above |
Q8 : Where is a file temporarily stored before read or write operation in C language?
Answer : Hard disk |
Q9 : What are the C functions used to read or write a file in Text Mode?
Answer : fprintf(),fscanf() |
Comments
Post a Comment
Please give us feedback through comments