C Programming MCQs with answers Page - 19

Here, you will find a collection of MCQ questions on C Programming. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. Variables of type auto, static and extern are all stored in?

  • (A) ROM
  • (B) RAM
  • (C) CPU
  • (D) Compiler

A

Admin • 833.24K Points
Coach

Q. Which among the following is a Local Variable?

  • (A) register
  • (B) auto
  • (C) static
  • (D) extern

A

Admin • 833.24K Points
Coach

Q. Which among the following is a Global Variable?

  • (A) auto
  • (B) register
  • (C) static
  • (D) extern

A

Admin • 833.24K Points
Coach

Q. Choose a correct statement about static variable.

  • (A) A static global variable can be accessed in other files.
  • (B) A static global variable can be used only in a file in which it is declared.
  • (C) A static global variable can not be declared without extern keyword.
  • (D) Default value of a static variable is -1.

A

Admin • 833.24K Points
Coach

Q. Choose right statement

Code:
register float a = 3.14f;
  • (A) Variable a is stored in CPU registers for fast access.
  • (B) Variable a is converted to int and then stored in a CPU register.
  • (C) register Storage Class is ignored and treated as auto float a = 3.14f;
  • (D) You get a compiler error as you can not store non integer value in a CPU register.

A

Admin • 833.24K Points
Coach

Q. What is the difference between Declaration and Definition.?

  • (A) Declaration does allocate memory for a variable. Definition does allocate memory for a variable.
  • (B) Declaration does allocate memory for a variable. Definition does not allocate memory for a variable.
  • (C) Declaration does not allocate memory for a variable. Definition does allocate memory for a variable.
  • (D) Declaration does not allocate memory for a variable. Definition does not allocate memory for a variable.

A

Admin • 833.24K Points
Coach

Q. Choose a right statement.

  • (A) A non static global variable can not be used in included files.
  • (B) A non static global variable can be used or referred to inside included files.
  • (C) A non static global variable does not live till the end of program execution.
  • (D) None of the above

A

Admin • 833.24K Points
Coach

Q. Choose a right statement.

  • (A) Redeclaration of a variable is Ok.
  • (B) Redefinition of a variable is not Ok.
  • (C) Definition of a variable uses memory blocks.
  • (D) All of the above

A

Admin • 833.24K Points
Coach

Q. Choose a correct statement.

  • (A) Register variables are usually fast retrieving variables.
  • (B) Static variables are usually maintain their values between function calls.
  • (C) Auto variables release their memory after the block or function where they are declared.
  • (D) All of the above

A

Admin • 833.24K Points
Coach

Q. Choose a right statement.

  • (A) Variables of type auto are stored in Stack memory.
  • (B) Variable of type Static are stored in Segmented Memory.
  • (C) Variables of type register are stored in Micro Processor Memory.
  • (D) All of the above