C Language MCQ’S | Declarations and Initializations

Exercise :: Declarations and Initializations – General Questions
Declarations and Initializations – General Questions
Declarations and Initializations – Find Output of Program
Declarations and Initializations – Point Out Errors
Declarations and Initializations – Point Out Correct Statements
Declarations and Initializations – True / False Questions
Declarations and Initializations – Yes / No Questions

16.
Which of the following is correct about err used in the declaration given below?

typedef enum error { warning, test, exception } err;
A. It is a typedef for enum error.
B. It is a variable of type enum error.
C. The statement is erroneous.
D. It is a structure.

17.
What is the output of the program?

#include<stdio.h>
int main()
{
extern int a;
printf(“%d\n”, a);
return 0;
}
int a=20;
A. 20
B. 0
C. Garbage Value
D. Error

18.
A long double can be used if range of a double is not enough to accommodate a real number.

A. True
B. False

19.
If the definition of the external variable occurs in the source file before its use in a particular function, then there is no need for an extern declaration in the function.

A. True
B. False

20.
Size of short integer and long integer can be verified using the sizeof() operator.

A. True
B. False

Visitor Counter

0051015