C++ Identifiers and Constants Quiz

C++ Identifiers and Constants Quiz

University

10 Qs

quiz-placeholder

Similar activities

T_4.2 Identifier, Data Types, Operators & Expressions

T_4.2 Identifier, Data Types, Operators & Expressions

12th Grade - University

10 Qs

LATIHAN PEMOGRAMAN PASCAL

LATIHAN PEMOGRAMAN PASCAL

University

10 Qs

C keywords and identifiers

C keywords and identifiers

9th Grade - University

10 Qs

Java

Java

9th Grade - University

11 Qs

CC103_COMPUTER_PROGRAMMING

CC103_COMPUTER_PROGRAMMING

University

15 Qs

FREEZER QUIZLINE

FREEZER QUIZLINE

University

11 Qs

C-Programming

C-Programming

University

15 Qs

Pop Quiz!! PSPD C3

Pop Quiz!! PSPD C3

University

10 Qs

C++ Identifiers and Constants Quiz

C++ Identifiers and Constants Quiz

Assessment

Quiz

Computers

University

Hard

Created by

NURUL (PMJ)

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid identifier in C++?

100students

Vari@bles

my_school

Playing Football

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the maximum number of characters allowed in an identifier in most programming languages?

31

15

50

100

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT allowed in an identifier name?

Letters

Numbers

Underscore (_)

Spaces

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In C++, what happens when you use an identifier that matches a reserved word?

The program will run as normal

The compiler will treat it as a special variable

It will cause a syntax error

It will be ignored

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for declaring a constant in C++?

const datatype variable_name;

datatype const variable_name = value;

datatype variable_name;

#define variable_name value

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an example of a reserved word in C++?

myVariable

int

my_school

student

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following data types can be used to declare a variable in C++?

char

int

float

All of the above

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?