Sail E0 Webinar

MCQs

Total Questions : 17 | Page 2 of 2 pages
Question 11. Size of a union is determined by size of the.
  1.    First member in the union
  2.    Last member in the union
  3.    Biggest member in the union
  4.    Sum of the sizes of all members
 Discuss Question
Answer: Option C. -> Biggest member in the union


None.


Question 12. What is the output of this C code?
void main()
{
struct student
{
int no;
char name[20];
};
struct student s;
s.no = 8;
printf("%d", s.no);
}
  1.    Nothing
  2.    Compile time error
  3.    Junk
  4.    8
 Discuss Question
Answer: Option D. -> 8


None.


Question 13. Number of bytes in memory taken by the below structure is?
struct test
{
int k;
char c;
};
  1.    Multiple of integer size
  2.    integer size+character size
  3.    Depends on the platform
  4.    Multiple of word size
 Discuss Question
Answer: Option B. -> integer size+character size


None.


Question 14. Comment on the following union declaration?
union temp
{
int a;
float b;
char c;
}; union temp s = {1,2.5,'A'}; //REF LINE     Which member of the union will be active after REF LINE?
  1.    a
  2.    b
  3.    c
  4.    Such declaration are illegal
 Discuss Question
Answer: Option A. -> a


None.


Question 15. What would be the size of the following union declaration?
union uTemp
{
double a;
int b[10];
char c;
}u;
(Assuming size of double = 8, size of int = 4, size of char = 1)
  1.    4
  2.    8
  3.    40
  4.    80
 Discuss Question
Answer: Option C. -> 40


None.


Question 16. Which of the following is not allowed?
  1.    Arrays of bit fields
  2.    Pointers to bit fields
  3.    Functions returning bit fields
  4.    None of the mentioned
 Discuss Question
Answer: Option D. -> None of the mentioned


None.


Question 17. Bit fields can only be declared as part of a structure.
  1.    false
  2.    true
  3.    Nothing
  4.    Varies
 Discuss Question
Answer: Option B. -> true


None.


Latest Videos

Latest Test Papers