This set of C Multiple Choice Questions & Answers (MCQs) focuses on “Sizeof Keyword – 1”.
Pre-requisite for this C MCQ set: Advanced C Programming Video Tutorial.
1. What is the sizeof(char) in a 32-bit C compiler?
a) 1 bit
b) 2 bits
c) 1 Byte
d) 2 Bytes
View Answer
Explanation: None.
2. What will be the output of the following C code?
#include <stdio.h> printf("%d", sizeof('a'));
a) 1
b) 2
c) 4
d) None of the mentioned
View Answer
Explanation: None.
3. Size of an array can be evaluated by __________
(Assuming array declaration int a[10];)
a) sizeof(a);
b) sizeof(*a);
c) sizeof(a[10]);
d) 10 * sizeof(a);
View Answer
Explanation: None.
4. What will be the output of the following C code?
#include <stdio.h>
union temp
{
char a;
char b;
int c;
}t;
int main()
{
printf("%d", sizeof(t));
return 0;
}
a) 1
b) 2
c) 4
d) 6
View Answer
Explanation: None.
5. Which of the following is not an operator in C?
a) ,
b) sizeof()
c) ~
d) None of the mentioned
View Answer
Explanation: None.
6. Which among the following has the highest precedence?
a) &
b) <<
c) sizeof()
d) &&
View Answer
Explanation: None.
7. What is the sizeof(void) in a 32-bit C?
a) 0
b) 1
c) 2
d) 4
View Answer
Explanation: None.
8. What type of value does sizeof return?
a) char
b) short
c) unsigned int
d) long
View Answer
Explanation: None.
Sanfoundry Global Education & Learning Series – C Programming Language.
To practice all areas of C language, here is complete set of 1000+ Multiple Choice Questions and Answers.
If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]
- Apply for Computer Science Internship
- Practice BCA MCQs
- Check Computer Science Books
- Apply for C Internship
- Watch Advanced C Programming Videos