Search Header Logo

C++ Basics for First Semester Students

Authored by Vicky Lagunes

Computers

1st Grade

Used 7+ times

C++ Basics for First Semester Students
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an array in C++?

An array in C++ is a single element of any type.

An array in C++ is a type of function that returns multiple values.

An array in C++ is a collection of elements of the same type stored in contiguous memory.

An array in C++ is a collection of elements of different types stored in random memory.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare an array in C++?

int[10] myArray;

array myArray[10];

int myArray[10];

myArray int[10];

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index of the first element in an array?

-1

1

5

0

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the third element of an array named 'arr'?

arr[1]

arr.get(2)

arr[2]

arr[3]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a function in C++?

A function in C++ is a reusable block of code that performs a specific task.

A function in C++ is a keyword used for loops.

A function in C++ is a data structure.

A function in C++ is a type of variable.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you define a function in C++?

function_name(parameter_list) return_type { // function body }

return_type function_name { // parameter_list }

A function in C++ is defined as: return_type function_name(parameter_list) { // function body }

function return_type { // function body }

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the return statement in a function?

The return statement pauses the function until it is called again.

The return statement allows a function to take user input.

The purpose of the return statement is to exit a function and return a value to the caller.

The return statement is used to print output to the console.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?