Classical

C Programming MCQ - Structure & Union

1:  

Consider the declaration:
static struct
         {    unsigned a:5;
              unsigned b:5;
              unsigned c:5;
            unsigned d:5%:
             }v=(1,2,3,4);

v occupies

A.

4 bytes

B.

2 bytes

C.

1 byte

D.

None of these

 
 

Option: A

Explanation :


2:  

A short integer occupies 2 bytes an, ordinary integer 4 bytes and a long integer occupies 8 bytes of memory
If a structure is defined as
struct TAB{
short a;
int b;
long c;
}TABLE[10];

the the total memory requirement for TABLE is

A.

14

B.

140

C.

40

D.

32

 
 

Option: B

Explanation :


3:  

The expression a<<6 shifts all bits of a six places to the left. If a 0x6db7, then what is the value of a<<6?

A.

0xa72b

B.

0xa3b

C.

0x6dc0

D.

0x1111

 
 

Option: C

Explanation :


4:  

The declaration
union id{
char color[12];
int size;}shirt,Jeans;

denotes shirt and Jeans are variable of type id and

A.

Each can have a value of color and size

B.

Each can represent either a 12-character color or an integer size at a time

C.

Shirt and Jeans are same as struct variables

D.

Variable shirt and Jeans cannot be used simultaneously in a statement

 
 

Option: B

Explanation :


5:   Most appropriate sentence to describe unions is
A. Union are like structures
B. Union contain members of different data types which share the same storage area in memory
C. Union are less frequently used in program
D. Union are used for set operations
 
 

Option: B

Explanation :




Suggest an improvement

 


Syllabus Covered in this section is

  • Elements of C-Tokens
  • Identifiers
  • data types in C
  • Control structures in, C
  •  Sequence, selection and iteration(s).
  • Structured data types in C
  • Arrays, Structures, union, String, and pointers
  • Functions, Recursion
  • Parameter passing, Scope
  •  Binding, Abstract data types

This Section covers Multiple Choice Questions Answers in C Programming . Here questions answers are given with explanation and references. These questions can be used for the preparation of various competitive and academic exams.

Who can benefit - 

  • Any undergraduate or postgraduate student who is seeking C Programming objective type questions answers can use this section.
  • C programming Multiple Choice questions Answers can help you in interview preparation.
  • C Programming Objective type Questions Answers are also used at SSC and HSc level for Exam preparation.
  • C Programming MCQ Questions Answers are also used by engineering students in the preparation of their Exams.
  • Any candidate who has to appear for DOEACC A, B or C level Exam can also learn C Programming Questions Answers.
  • All the teachers who are appearing for Kendriya Vidyalya Sangathan Entrance Exam can also use C Programming Multiple Choice Questions Answers.
  • C Programming MCQs can also be used by the students who are pursuing B.Sc or Msc Computer Science.
  • C Programming Questions Answers can also be used by BCA students for the preparation of their exams.
  • Any student who is pursuing B.Sc. in Information Technology can also use this C Programming mcq Questions Answers.
  •  MCA students can also prepare for their exams using  C Programming Objective Type Questions Answers.
  • You can get free access to C Programming mcq pdf.
  • You can also have online access to C Programming Questions Answers EBook.

Various Search Terms used for this section are

  • C Programming quiz questions with answers

  • C Programming exam questions answers

  • C Programming MCQ questions Answers

  • C Programming MCQ

  • C Programming Questions Answers