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.
Show Answer
2. What are the types of linkages?
  • Internal and External
  • External, Internal and None
  • External and None
  • Internal
Show Answer
3. Which of the following special symbol allowed in a variable name?
  • * (asterisk)
  • | (pipeline)
  • - (hyphen)
  • _ (underscore)
Show Answer
4. Is there any difference between following declarations?
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
Show Answer
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)
Show Answer
6. By default a real number is treated as a
  • float
  • double
  • long double
  • far double
Show Answer
7. Is the following statement a declaration or definition?
extern int i;
  • Declaration
  • Definition
  • Function
  • Error
Show Answer
8. Identify which of the following are declarations
extern int x;
float square ( float x ) { ... }
double pow(double, double);
  • 1
  • 2
  • 1 and 3
  • 3
Show Answer
9. When we mention the prototype of a function?
  • Defining
  • Declaring
  • Prototyping
  • Calling
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test