Algorimt/program-2

Algorimt/program-2

University

59 Qs

quiz-placeholder

Similar activities

Evaluación de Bases de Datos Avanzadas

Evaluación de Bases de Datos Avanzadas

University

57 Qs

MS  Excel

MS Excel

University

63 Qs

Generative AI/Fairness and Ethics

Generative AI/Fairness and Ethics

University

64 Qs

Thiết Kế Web bài 2

Thiết Kế Web bài 2

University

58 Qs

MIDTERM EXAM - OS

MIDTERM EXAM - OS

University

55 Qs

COMPUTER HARDWARE FUNDAMENTALS FINAL ALL QUIZ

COMPUTER HARDWARE FUNDAMENTALS FINAL ALL QUIZ

University

64 Qs

Rogic

Rogic

12th Grade - University

60 Qs

Summative - Python

Summative - Python

University

60 Qs

Algorimt/program-2

Algorimt/program-2

Assessment

Quiz

Information Technology (IT)

University

Practice Problem

Easy

Created by

H1ro [kz]

Used 4+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

59 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What is an array in C++?

A collection of elements of the same type stored in contiguous memory locations

A single variable that holds multiple values of different types

A function that performs calculations

A keyword for declaring variables

2.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

How do you declare an integer array of size 5 in C++?

int array[5];

array<int> arr(5);

int array = {5};

int array[];

3.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

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

0

-1

1

Depends on the array size

4.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What will happen if you access an array index that is out of bounds?

It will return 0 by default

The program will crash

Undefined behavior

Compiler error

5.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Which of the following is NOT a valid array declaration?

int arr[5];

double data[] = new double[5];

float numbers[10];

char str[20];

6.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Which statement correctly initializes an array?

int arr[3] = {1, 2, 3};

int arr = {1, 2, 3};

arr[3] = {1, 2, 3};

int arr[3]; arr = {1, 2, 3};

 

7.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What will be the output of the following code? int arr[] = {10, 20, 30, 40}; cout << arr[2];

30

20

10

40

Create a free account and access millions of resources

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?