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

31. What is the size of an int data type in C?

  • 2 bytes
  • 4 bytes
  • 8 bytes
  • Depends on compiler
Show Answer Report

32. Which keyword is used to define a constant in C?

  • constant
  • define
  • const
  • fixed
Show Answer Report

33. What is the default value of a static variable in C?

  • 0
  • 1
  • Garbage value
  • NULL
Show Answer Report

34. Which of the following is a valid declaration?

  • int arr[0];
  • int arr[];
  • int arr[5];
  • int arr[-5];
Show Answer Report

35. What does the "volatile" keyword indicate?

  • Variable cannot be changed
  • Variable is optimized
  • Variable may change unexpectedly
  • Variable is constant
Show Answer Report

36. Which storage class has the longest scope?

  • auto
  • register
  • static
  • extern
Show Answer Report

37. What is the output of: printf("%d", sizeof('A'));

  • 1
  • 2
  • 4
  • 8
Show Answer Report

38. Which is correct for declaring a pointer?

  • int ptr*;
  • int *ptr;
  • *int ptr;
  • int pointer;
Show Answer Report

39. What is the maximum length of a C identifier?

  • 31 characters
  • 63 characters
  • 79 characters
  • 255 characters
Show Answer Report

40. Which is not a fundamental data type in C?

  • int
  • float
  • char
  • string
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test