Loading...

C Multiple Choice Questions

Our C questions and answers focuses on all areas of C programming language covering 100+ topics in C

C Structures-2 MCQs

C Structures-2


1. Which of the following operation is illegal in structures?

a) Typecasting of structure>
b) Pointer to a variable of the same structure>
c) Dynamic allocation of memory for structure>
d) All of the mentioned>



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

a) Syntax Error
b) Structure
c) double data type
d) An ordinary variable name



3. Which of the following are themselves a collection of different data types?

a) String
b) Structure
c) Char
d) All of the mentioned



4. Which operator connects the structure name to its member name?

a) -
b) .
c) Both (b) and (c)
d) None of these



5. Which of the following cannot be a structure member?

a) Another structure
b) Function
c) Array
d) None of the mentioned



6. Which of the following structure declaration will throw an error?

a)

struct temp{

}s;
main(){

}

b)
struct temp{

};
structtemp s;
main(){

}

c)
struct temp s;
struct temp{

};
main(){

}

d) None of the mentioned



7. What are the types of data allowed inside a structure?

a) int, float, double, long double
b) char, enum, union
c) pointers and Same structure type members
d) All the above



8. What is actually passed if you pass a structure variable to a function?

a) Copy of structure variable
b) Reference of structure variable
c) Starting address of structure variable
d) Ending address of structure variable



9. Which of the following return-type cannot be used for a function in C?

a) An array stores only elements of same type. Accessing elements is easy
b) A structure is preferred when different type elements are to be combined as a single entity
c) An array implementation has performance improvements to structure
d) All the above



10. Which properly declares a variable of struct foo?

a) struct foo;
b) struct foo var;
c) foo;
d) int foo;



- Related Topics