C- Declarations and Initializations
C- Declarations and Initializations
1. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
- rem = 3.14 % 2.1;
- rem = modf(3.14, 2.1);
- rem = fmod(3.14, 2.1);
- Remainder cannot be obtain in floating point division.
2. What are the types of linkages?
- Internal and External
- External, Internal and None
- External and None
- Internal
3. Which of the following special symbol allowed in a variable name?
- * (asterisk)
- | (pipeline)
- - (hyphen)
- _ (underscore)
4. Is there any difference between following declarations?
1 : extern int fun();
2 : int fun();
1 : extern int fun();
2 : int fun();
- Both are identical
- No difference, except extern int fun(); is probably in another file
- int fun(); is overrided with extern int fun();
- None of these
5. How would you round off a value from 1.66 to 2.0?
- ceil(1.66)
- floor(1.66)
- roundup(1.66)
- roundto(1.66)
7. Is the following statement a declaration or definition?
extern int i;
extern int i;
- Declaration
- Definition
- Function
- Error
8. Identify which of the following are declarations
extern int x;
float square ( float x ) { ... }
double pow(double, double);
extern int x;
float square ( float x ) { ... }
double pow(double, double);
- 1
- 2
- 1 and 3
- 3