C++ Identifiers and Constants Quiz

C++ Identifiers and Constants Quiz

University

10 Qs

quiz-placeholder

Similar activities

Object Oriented Programming

Object Oriented Programming

University

10 Qs

Quiz 1

Quiz 1

University

15 Qs

OOPJ- Data Types-Java

OOPJ- Data Types-Java

University

10 Qs

C Viva

C Viva

University

10 Qs

constants

constants

University

10 Qs

FGCT4023 Topic 2 - Data

FGCT4023 Topic 2 - Data

University

10 Qs

PLSQL-Introduction

PLSQL-Introduction

University

12 Qs

POINTERS

POINTERS

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?