C Structures-1
1. What will be the size of the following structure?
#include <stdio.h>
struct temp {
int a[10];
char p;
};
a) 5
b) 11
c) 41
d) 44
Answer: D
No explanation is given for this question.
2. What is a structure in C language?
a) A structure is a collection of elements that can be of same datatype
b) A structure is a collection of elements that can be of different datatype
c) Elements of a structure are called members
d) All of the these
Answer: D
No explanation is given for this question.
3. What is the size of a C structure?
a) C structure is always 128 bytes
b) Size of C structure is the totatl bytes of all elements of structure
c) Size of C structure is the size of largest elements
d) None of the above
Answer: B
Individually calculate the sizes of each member of a structure and make a total to get Full size of a structure.
4. Choose a correct statement about C structure?
int main() {
struct ship {
};
return 0;
}
a) It is wrong to define an empty structure
b) Member variables can be added to a structure even after its first definition
c) There is no use of defining an empty structure
d) None of the above
Answer: B
No explanation is given for this question.
5. Choose a correct statement about C structure elements?
a) Structure elements are stored on random free memory locations
b) structure elements are stored in register memory locations
c) structure elements are stored in contiguous memory locations
d) None of the above
Answer: C
No explaination is given for that question.
6. A C structure or User defined datatype is also called ________.
a) Derived data type
b) Secondary data type
c) Aggregate data type
d) All the above
Answer: D
No explaination is given for this question.
7. What are the uses of C Structures?
a) structure is used to implement Linked Lists, Stack and Queue data structures
B) Structures are used in Operating System functionality like Display and Input taking
C) Structure are used to exchange information with peripherals of PC
D) All the above
Answer: D
No explaination is given for this question.
8. Choose a correct statement about C structures.
a) A structure can contain same structure type member
b) A structure size is limited by only physical memory of that PC
c) You can define an unlimited number of members inside a structure
d) All the above
Answer: D
No explaination is given for this question.
9. Which of the following return-type cannot be used for a function in C?
a) char *
b) struct
c) void
d) none of the mentioned
Answer: D
No explaination is given for this question.
10. Which of the following is not possible under any scenario?
a) s1 = &s2;
b) s1 = s2;
c) (*s1).number = 10;
d) None of the mentioned
Answer: D
No explaination is given for this question.