C language MCQ’s | miscellaneous 2

11.
Which of the following storage classes have global visibility in C?
A. Auto
B. Static
C. Extern
D. Register

12.
A full binary tree with n leaves contains
A. n nodes
B. 2n – 1 nodes
C. log2 n nodes
D. 2n nodes

13.
The Case keyword is followed by?
A. Float values
B. Character values
C. Integer values
D. Both B & C

14.
Type of data and its value is described dy
A. Constants
B. Variables
C. Data Type
D. None of the above

15.
myarr[5] is equivalent of?
A. &(myarr + 5)
B. *(myarr + 5)
C. (*myarr + 5)
D. None of the above

16.
How to make an infinity loop in C?
A. loop: ….. goto loop;
B. for(;;) { }
C. while(1) { }
D. All of the above

17.
What does the following declaration mean? int (*ptr) [10];
A. ptr is an array of pointers of 10 integers.
B. ptr is a pointer to an array of 10 integers.
C. ptr is an array of 10 integers.
D. None of the above

18.
The correct way to round off a floating number x to an integer value is
A. y = int (x + 0.5)
B. y = (int) (x + 0.5)
C. y = (int) x + 0.5
D. y = (int) ((int)x + 0.5)

19.
Which of the following has compilation error in C?
A. int n = 32;
B. char ch = 65;
C. float f = (float) 3.2;
D. None of the above

20.
What is default storage class of variables in C language?
A. extern
B. local
C. auto
D. global

Visitor Counter

0051089