Identifier, Variable & Constant

Identifier, Variable & Constant

11th Grade

7 Qs

quiz-placeholder

Similar activities

NISD CS AP Exam Prep

NISD CS AP Exam Prep

10th - 12th Grade

12 Qs

Primitives Quiz Review

Primitives Quiz Review

10th - 12th Grade

10 Qs

Single Array

Single Array

11th Grade

10 Qs

1D Arrays

1D Arrays

11th Grade

10 Qs

One Dimensional Arrays

One Dimensional Arrays

11th Grade

10 Qs

Java

Java

11th Grade

10 Qs

A3 IIB - Estructuras Condicionales I

A3 IIB - Estructuras Condicionales I

10th Grade - University

10 Qs

C sharp

C sharp

11th Grade

9 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