Home / C Programming / Declarations and Initializations :: General Questions

### C Programming :: Declarations and Initializations

1. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?

2.  A. rem = 3.14 % 2.1; B. rem = modf(3.14, 2.1); C. rem = fmod(3.14, 2.1); D. Remainder cannot be obtain in floating point division.

3. What are the types of linkages?

4.  A. Internal and External B. External, Internal and None C. External and None D. Internal

5. Which of the following special symbol allowed in a variable name?

6.  A. * (asterisk) B. | (pipeline) C. - (hyphen) D. _ (underscore)

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

8.  A. True B. False

9. Is there any difference between following declarations?

 1 : extern int fun(); 2 : int fun();

10.  A. Both are identical B. No difference, except extern int fun(); is probably in another file C. int fun(); is overrided with extern int fun(); D. None of these

11. How would you round off a value from 1.66 to 2.0?

12.  A. ceil(1.66) B. floor(1.66) C. roundup(1.66) D. roundto(1.66)

13. By default a real number is treated as a

14.  A. float B. double C. long double D. far double

15. Which of the following is not user defined data type?

 1 : struct book { char name[10]; float price; int pages; }; 2 : long int l = 2.35; 3 : enum day {Sun, Mon, Tue, Wed};

16.  A. 1 B. 2 C. 3 D. Both 1 and 2

17. Is the following statement a declaration or definition?
extern int i;

18.  A. Declaration B. Definition C. Function D. Error

19. Identify which of the following are declarations

 1 : extern int x; 2 : float square ( float x ) { ... } 3 : double pow(double, double);

20.  A. 1 B. 2 C. 1 and 3 D. 3