C- Declarations and Initializations Questions and Answers
Understanding C Declarations and Initializations is fundamental for mastering C programming. These concepts are frequently covered in programming questions and answers for placement tests and technical interviews at companies like TCS, Infosys, and Wipro. Declarations define variables, while initializations assign values to them, both ensuring efficient memory and data handling in C. This guide provides C programming MCQs and practical examples that clarify variable scope, storage classes, and initialization rules. Ideal for both beginners and job seekers, it strengthens your coding logic and interview readiness with real-world examples and practice problems.
C- Declarations and Initializations
Showing 10 of
49 questions
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();
- 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;
- Declaration
- Definition
- Function
- Error
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
9. When we mention the prototype of a function?
- Defining
- Declaring
- Prototyping
- Calling
10. Which of the following is a valid variable declaration in C?
- int 2var;
- int _var;
- int var-iable;
- int @var;