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 : Click on Discuss to view users comments. |
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 : Click on Discuss to view users comments. sonali manohar shelke said: (8:56am on Monday 18th December 2017)
a is short which occupies 2 bytes per element so there are 10 elements which equal to 20 bytes for ab is int which contains 4 bytes per element so again they alson contain 10 elements which is equal to 40 bytesand c is long which occupies 80 bytes for 10 elements' 80 total memory space occupied is 20 40 80=140so option B is correct
|
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 : Click on Discuss to view users comments. |
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 : Click on Discuss to view users comments. |
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 : Click on Discuss to view users comments. |
Syllabus Covered in this section is
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 -
Various Search Terms used for this section are