ADS Quiz 2

ADS Quiz 2

University

50 Qs

quiz-placeholder

Similar activities

Java Assessment-1

Java Assessment-1

University

50 Qs

HTML,CSS AND JS QUIZ

HTML,CSS AND JS QUIZ

University

50 Qs

Data Structure Using C _PG_Pretest

Data Structure Using C _PG_Pretest

University

50 Qs

Pre-Test Praktikum

Pre-Test Praktikum

University

50 Qs

C Progarm 2

C Progarm 2

University

51 Qs

Quiz 1 - Logika Algoritma dan Pemrograman

Quiz 1 - Logika Algoritma dan Pemrograman

12th Grade - University

51 Qs

C Programming Quiz

C Programming Quiz

University

51 Qs

Test 2

Test 2

University

50 Qs

ADS Quiz 2

ADS Quiz 2

Assessment

Quiz

Computers

University

Hard

Created by

Naman Chauhan

Used 1+ times

FREE Resource

50 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is an array of integers initialized in C++?

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

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

int arr = {1, 2, 3, 4, 5};

int arr[5] = 1, 2, 3, 4, 5;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true for the initialization of a C++ array?

Arrays must always be initialized explicitly in C++

Arrays are automatically initialized with zero values in C++

C++ allows both explicit and default initialization for arrays

Arrays cannot be initialized in C++

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the term "contiguous memory" mean in the context of arrays?

Each element of an array is stored in a different location in memory

The elements of the array are stored in consecutive memory locations

Arrays in C++ don't use memory

Memory in arrays is randomly allocated

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid way to declare a dynamically allocated array in C++?

int arr[5];

int* arr = new int[5];

int arr = new int[5];

int arr(5);

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to deallocate memory used by a dynamically allocated array in C++?

delete arr;

delete[] arr;

free(arr);

dealloc(arr);

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax to define a two-dimensional array in C++?

int arr[3][4];

int arr[4, 3];

int arr(3)(4);

int[3][4] arr;

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default initialization value for elements of an array in C++ when no value is provided?

Zero

Garbage value

Null

Undefined

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?