C++ Variables and Data Types

Last Updated :
Discuss
Comments

Question 1

Which is a valid C++ data type?

  • A

    integer

  • B

    float

  • C

    number

  • D

    real

Question 2

What does the const keyword do?

  • A

    Allocates dynamic memory

  • B

    Makes a variable modifiable

  • C

    Defines a function

  • D

    Prevents variable modification

Question 3

What is the purpose of the auto keyword?

  • A

    Declares a constant

  • B

    Deduces variable type

  • C

    Allocates memory

  • D

    Defines a loop

Question 4

What is a constexpr used for?

  • A

    Runtime evaluation

  • B

    Compile-time evaluation

  • C

    Dynamic memory allocation

  • D

    Function definition

Question 5

What is the purpose of a variable in C++?

  • A

    To repeat a set of instructions multiple times

  • B

    To store data that can be used and modified during program execution

  • C

    Define functions

  • D

    To define reusable blocks of code

Tags:

There are 5 questions to complete.

Take a part in the ongoing discussion