constants Questions and Answers

Take Exam

Constants are one of the most fundamental topics in C programming. This set of constants in C language questions with answers covers the use and declaration of constants, symbolic names, and constant data types. For students preparing for GATE, Infosys, or Tech Mahindra placement exams, understanding constants helps you write more reliable and readable code. These C programming MCQs are designed to strengthen your basics in data storage, syntax, and memory management. Each question includes clear explanations to help you differentiate between literals, symbolic constants, and macros effectively.

constants

Showing 10 of 30 questions

21. What is the advantage of using #define over const?

  • Type checking
  • Memory allocation
  • Scope
  • No memory allocation
Show Answer Report

22. Which constant cannot be modified?

  • const variable
  • #define constant
  • Both
  • None
Show Answer Report

23. What is the size of const int?

  • 1 byte
  • 2 bytes
  • 4 bytes
  • Same as int
Show Answer Report

24. How to make a constant floating point value?

  • const 3.14;
  • const float pi = 3.14;
  • constant 3.14;
  • float const = 3.14;
Show Answer Report

25. What is the problem with: const int x; x=10;?

  • No problem
  • Missing semicolon
  • Redeclaration
  • Cannot assign to const variable
Show Answer Report

26. Which is correct for constant array?

  • const int arr[5];
  • int const arr[5];
  • const arr[5];
  • Both 1 and 2
Show Answer Report

27. What does const in function parameter mean?

  • Parameter is constant
  • Parameter cannot be modified
  • Parameter is read-only
  • All of the above
Show Answer Report

28. How to define multiple constants in one line?

  • const int a,b,c=10;
  • const int a=1,b=2,c=3;
  • const int a;b;c;
  • const int a=b=c=5;
Show Answer Report

29. What is enum constant in C?

  • Integer constant with names
  • Floating point constant
  • String constant
  • Character constant
Show Answer Report

30. Which is true about #define constants?

  • Type checked
  • Memory allocated
  • No type checking
  • Cannot be used in expressions
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test