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
21. What does the volatile keyword indicate?
- Variable cannot be changed
- Variable may change unexpectedly
- Variable is constant
- Variable is stored in register
22. Which of the following is not a primitive data type in C?
- int
- float
- char
- array
23. What is the maximum length of a variable name in C?
- 31 characters
- 63 characters
- 255 characters
- No fixed limit
24. Which of the following is a valid constant declaration?
- const int x = 5;
- #define x 5
- int const x = 5;
- All of the above
25. What is the scope of a local variable?
- Entire program
- Within the function
- Within the file
- Global scope
28. Which of the following is a valid array declaration?
- int arr[];
- int arr[5];
- int arr[] = {1,2,3};
- Both B and C
29. What does the register keyword suggest to the compiler?
- Store in heap
- Store in register
- Make variable constant
- Make variable global
30. Which of the following is not a valid C variable name?
- 1number
- number1
- _number
- Number