MCQ on Structure and Union in c

Hello students welcome to CSE Study247 Today I am provide you MCQ on Structure and Union in c.

This page provide 20 Multiple choice question with Answer that is very useful of Computer science students like preparation of many exam Like ( ISRO,DRDO ,Semester, Interview, TCS , Railway & another Government Sector)

❤️ TOP 500+ C Programming Question and Answer

C programming is the basic language of programming that help to learn another language. So this MCQ is very useful for you.

C-Programming-MCQ-Multiple-Choice-Questions

C is a general purpose ,high level language that originally developed by Dennis Ritchie to develop the UNIX operating system at Bell labs.

 

Q.1 Structure is —- data type.





ANSWER= (B) User Define

 

Q.2 Structure members are access using — operator.





ANSWER= (A) dot

 

Q.3 Union is a ?





ANSWER= (B) User define data type

 

Q.4 A C Structure or User defined data type is also called





ANSWER= (C) Both A & B

 

Q.5 Find out the output for the following program

  void main()
  {
  struct man
  {
  int c;
  }
  struct man man1;
  man1.c=4;
  printf(“Child=%d”,man1.c);
  }






ANSWER= (C) Child=4

 

Q.6 —- Allows to combine data items of different kinds ?





ANSWER= (C) Structure

 

Q.7 The restrictions with union is ?





ANSWER= (B) The first member can be initialized

 

Q.8 Which of the following operation is illegal in structures?r to that structure ?





ANSWER= (B) Typecasting of structure

 

Q.9 Which of the following uses structure ?





ANSWER= (D) All of these

 

Q.10 Number of bytes in memory taken by the below structure is ?

  struct test
  {
  int a;
  char b;
  };






ANSWER= (B) integer size + character size

 

Q.11 In a structure operator . is called as ?





ANSWER= (C) Both A & B

 

Q.12 A structure is used is used to when we wish to store ?





ANSWER= (A) Dissimilar

 

Q.13 Identify the correct statement ?





ANSWER= (C) Both A & B

 

Q.14 Which of the following can not be a structure member ?





ANSWER= (B) Function

 

Q.15 Find out the output for the following program

  void main()
  {
  struct stock
  {
  int items;
 char name[10];
  }
 a;
  strcpy(a.name,”computer”);
 a.items=525
  printf(“Name=%s items=%d”,a.name,a.items);
  }






ANSWER= (C) Name=computer items=525

 

Q.16 structure is a ?





ANSWER= (D) All of these

 

Q.17 To access the members of a structure using a pointer to that structure,you must use the —- operator





ANSWER= (D) ->

 

Q.18 Which operator connects the structure name to its member name ?





ANSWER= (B) .

 

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





ANSWER= (B) Structure

 

Q.20 How many bytes will be consume memory of given union ?

  union student
  {
  int rollno;
 char name[40];
  float marks;
  }
  std[12];






ANSWER= (C) 480

1. Official Telegram Click Here
2. Telegram For CSE MCQs Click Here
3. You TubeClick Here
error: Content is protected !!