Sail E0 Webinar

MCQs

Total Questions : 17 | Page 1 of 2 pages
Question 1. Which of the following share a similarity in syntax?      1. Union, 2. Structure, 3. Arrays and 4. Pointers
  1.    3 and 4
  2.    1 and 2
  3.    1 and 3
  4.    1, 3 and 4
 Discuss Question
Answer: Option B. -> 1 and 2


None


Question 2. Members of a union are accessed as________________.
  1.    union-name.member
  2.    union-pointer->member
  3.    Both a & b
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> Both a & b


None.


Question 3. For what minimum value of x in a 32-bit Linux OS would make the size of s equal to 8 bytes?
struct temp
{
int a : 13;
int b : 8;
int c : x;
}s;
  1.    4
  2.    8
  3.    12
  4.    32
 Discuss Question
Answer: Option C. -> 12


None.


Question 4. Which of the following data types are accepted while declaring bit-fields?
  1.    char
  2.    float
  3.    double
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> char


None.


Question 5. In the declaration of bit-fields,     struct-declarator:     declarator     type-specifier declarator opt : constant-expression     The constant-expression specifies
  1.    The width of the field in bits.
  2.    Nothing
  3.    The width of the field in bytes.
  4.    Error
 Discuss Question
Answer: Option A. -> The width of the field in bits.


None.


Question 6. Which of the following are themselves a collection of different data types?
  1.    String
  2.    Structure
  3.    Char
  4.    All of the mentioned
 Discuss Question
Answer: Option B. -> Structure


None.


Question 7. User-defined data type can be derived by___________.
  1.    struct
  2.    enum
  3.    typedef
  4.    All of the mentioned
 Discuss Question
Answer: Option D. -> All of the mentioned


None.


Question 8. Which of the following cannot be a structure member?
  1.    Another structure
  2.    Function
  3.    Array
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> Function


None.


Question 9. Which operator connects the structure name to its member name?
  1.    -
  2.    .
  3.    Both (b) and (c)
 Discuss Question
Answer: Option B. -> .


None.


Question 10. Which of the following structure declaration will throw an error?
  1.    struct temp{}s; main(){}
  2.    struct temp{}; struct temp s; main(){}
  3.    struct temp s; struct temp{}; main(){}
  4.    None of the mentioned
 Discuss Question
Answer: Option D. -> None of the mentioned


None.


Latest Videos

Latest Test Papers