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
11. What is the default value of an uninitialized local variable in C?
- 0
- NULL
- Garbage value
- 1
13. What is the size of int data type in C?
- 2 bytes
- 4 bytes
- 8 bytes
- Compiler dependent
15. What does the extern keyword do?
- Defines a new variable
- Declares a variable defined elsewhere
- Makes variable constant
- Allocates memory for variable
18. Which of the following is a valid way to declare and initialize a string?
- char str[] = "Hello";
- char str = "Hello";
- string str = "Hello";
- char *str = 'H';
19. What is the value of an uninitialized global variable?
- 0
- Garbage value
- NULL
- Undefined
20. Which of the following is a valid floating point declaration?
- float f = 3.14;
- float f = 3.14f;
- double d = 3.14;
- All of the above