c++ arrays

c++ arrays

University

10 Qs

quiz-placeholder

Similar activities

Java Programming-1

Java Programming-1

University

10 Qs

Вказівник

Вказівник

12th Grade - University

12 Qs

Quiz 2 DS1D

Quiz 2 DS1D

University

12 Qs

unit3 pointers

unit3 pointers

University

10 Qs

Java Quiz based on array

Java Quiz based on array

University

15 Qs

module3

module3

University

15 Qs

Alabi, Kolade, CSCI-2380-01P, POST

Alabi, Kolade, CSCI-2380-01P, POST

University

10 Qs

C++ Array

C++ Array

University

10 Qs

c++ arrays

c++ arrays

Assessment

Quiz

Computers

University

Easy

Created by

Lakshmi B

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly declares an array?

int array;

array{10};

array array[10];

int array[10];

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid way to initialize an array in C?

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

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

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

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

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to access the third element of an array named 'numbers' in C?

numbers[3];

numbers(3);

numbers{3};

numbers[2];

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to declare a 2D array in C?

int arr[3][3];

arr{3,3};

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

int arr = [3][3];

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you find the length of an array in C?

Using the sizeOf() function;

By counting the number of elements in the array;

There is no direct way to find the length of an array in C;

Using the length() method;

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following array declaration: int arr[5] = {0};. What will be the value of arr[4]?

Garbage value

0

undefined

1

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

1
-1
0
null

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?