C- Declarations and Initializations Questions and Answers

Take Exam

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
Show Answer Report

22. Which of the following is not a primitive data type in C?

  • int
  • float
  • char
  • array
Show Answer Report

23. What is the maximum length of a variable name in C?

  • 31 characters
  • 63 characters
  • 255 characters
  • No fixed limit
Show Answer Report

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
Show Answer Report

25. What is the scope of a local variable?

  • Entire program
  • Within the function
  • Within the file
  • Global scope
Show Answer Report

26. Which operator is used to get the address of a variable?

  • *
  • &
  • @
  • #
Show Answer Report

27. What is the output of: int x = 5; printf("%d", x++);

  • 5
  • 6
  • 0
  • Undefined
Show Answer Report

28. Which of the following is a valid array declaration?

  • int arr[];
  • int arr[5];
  • int arr[] = {1,2,3};
  • Both B and C
Show Answer Report

29. What does the register keyword suggest to the compiler?

  • Store in heap
  • Store in register
  • Make variable constant
  • Make variable global
Show Answer Report

30. Which of the following is not a valid C variable name?

  • 1number
  • number1
  • _number
  • Number
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test