Declarations and Initializations Questions And Answers.


1.Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
A. rem = fmod(3.14, 2.1);
B. rem = 3.14 % 2.1;
C. rem = modf(3.14, 2.1);
D. Remainder cannot be obtain in floating point division

2.What are the types of linkages?
A. Internal
B. External and None
C. External, Internal and None
D. Internal and External

3.Which of the following special symbol allowed in a variable name?
A. - (hyphen)
B. _ (underscore)
C. | (pipeline)
D. * (asterisk)

4.Is there any difference between following declarations?
1 : extern int fun();
2 : int fun();
A. No difference, except extern int fun(); is probably in another file
B. int fun(); is overrided with extern int fun();
C. Both are identical
D. None of above

5.How would you round off a value from 1.66 to 2.0?
A. roundto(1.66)
B. roundup(1.66)
C. floor(1.66)
D. ceil(1.66)