C language MCQ’s | miscellaneous 2

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

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

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

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

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

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

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

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)

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

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

Visitor Counter