C++ Identifiers and Constants Quiz

C++ Identifiers and Constants Quiz

University

10 Qs

quiz-placeholder

Similar activities

FOP - RECAP CHAP 3

FOP - RECAP CHAP 3

University

15 Qs

C Programming Quiz-1

C Programming Quiz-1

University

10 Qs

Preguntas sobre Algoritmos y JavaScript

Preguntas sobre Algoritmos y JavaScript

University

10 Qs

L10 OS LAB WS24 14-2-24

L10 OS LAB WS24 14-2-24

University

13 Qs

C++ pointers

C++ pointers

University

8 Qs

science day competition(AI)

science day competition(AI)

University

10 Qs

Java Quiz 1

Java Quiz 1

University

10 Qs

FSWI - CH4 T1

FSWI - CH4 T1

KG - Professional Development

15 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?