Identifier, Variable & Constant

Identifier, Variable & Constant

11th Grade

7 Qs

quiz-placeholder

Similar activities

Project-Stem Unit 1 python coding

Project-Stem Unit 1 python coding

9th - 12th Grade

12 Qs

Project STEM AP CS A Unit 1 Quiz Review

Project STEM AP CS A Unit 1 Quiz Review

9th - 12th Grade

11 Qs

Java Boolean Statements

Java Boolean Statements

11th Grade

11 Qs

Primitives Quiz Review

Primitives Quiz Review

10th - 12th Grade

10 Qs

Programming C#

Programming C#

11th Grade

10 Qs

Java while loops

Java while loops

10th - 12th Grade

10 Qs

A3 IIB - Estructuras Condicionales I

A3 IIB - Estructuras Condicionales I

10th Grade - University

10 Qs

A4 IIB - Estructuras Condicionales II

A4 IIB - Estructuras Condicionales II

10th Grade - University

10 Qs

Identifier, Variable & Constant

Identifier, Variable & Constant

Assessment

Quiz

Computers

11th Grade

Hard

Created by

Alvin Muslim Sardar

FREE Resource

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is a valid C++ identifier?

  • 2variable

  • variable_name

  • variable-name

  • @variable

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

  • Which of the following is a correct way to declare an integer variable in C++?

int 1number;

integer num;

int number;

num int;

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What keyword is used to define a constant in C++?

constant

const

fixed

static

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How do you initialize a variable in C++?

int num = 10;

int num : 10;

num = int 10;

int = num 10;

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What will be the output of the following code snippet?

0

5

value

error

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will happen if you try to modify a 'const' variable in C++?

The code will compile successfully

The value will be changed

An error will occur

The program will crash

7.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Which of the following correctly represents a floating-point constant in C++?

3.14

3.14f

3.14F

All correct