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

41. What is the return type of malloc() function?

  • int*
  • void*
  • float*
  • char*
Show Answer Report

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

  • *
  • #
  • &
  • %
Show Answer Report

43. What is the value of an uninitialized local variable?

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

44. Which is used for logical NOT operation?

  • &
  • |
  • !
  • ~
Show Answer Report

45. What is the format specifier for double?

  • %d
  • %f
  • %lf
  • %Lf
Show Answer Report

46. Which header file is needed for printf()?

  • stdlib.h
  • stdio.h
  • conio.h
  • math.h
Show Answer Report

47. What is the scope of a local variable?

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

48. Which is the correct way to declare a function?

  • function name(){}
  • int function_name();
  • declare function();
  • function int();
Show Answer Report

49. What does "auto" storage class indicate?

  • External storage
  • Automatic storage
  • Static storage
  • Register storage
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test