C- Declarations and Initializations Questions and Answers

Practice Mode
Showing 10 of 49 questions
Q1
Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
  • 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.
Answer: Option C
Q2
What are the types of linkages?
  • A Internal and External
  • B External, Internal and None
  • C External and None
  • D Internal
Answer: Option B
Q3
Which of the following special symbol allowed in a variable name?
  • A * (asterisk)
  • B | (pipeline)
  • C - (hyphen)
  • D _ (underscore)
Answer: Option D
Q4
Is there any difference between following declarations? 1 :     extern int fun(); 2 :     int fun();
  • 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
Answer: Option B
Q5
How would you round off a value from 1.66 to 2.0?
  • A ceil(1.66)
  • B floor(1.66)
  • C roundup(1.66)
  • D roundto(1.66)
Answer: Option A
Q6
By default a real number is treated as a
  • A float
  • B double
  • C long double
  • D far double
Answer: Option B
Q7
Is the following statement a declaration or definition? extern int i;
  • A Declaration
  • B Definition
  • C Function
  • D Error
Answer: Option A
Q8
Identify which of the following are declarations extern int x; float square ( float x ) { ... } double pow(double, double);
  • A 1
  • B 2
  • C 1 and 3
  • D 3
Answer: Option C
Q9
When we mention the prototype of a function?
  • A Defining
  • B Declaring
  • C Prototyping
  • D Calling
Answer: Option B
Q10
Which of the following is a valid variable declaration in C?
  • A int 2var;
  • B int _var;
  • C int var-iable;
  • D int @var;
Answer: Option B
Explanation: Valid variable names cannot start with numbers or contain special characters except underscore.
Questions and Answers for Competitive Exams Various Entrance Test