CS1010 Lab 4

CS1010 Lab 4

University

10 Qs

quiz-placeholder

Similar activities

DATA STRUCTURES QUIZ

DATA STRUCTURES QUIZ

University

15 Qs

Java for Geeks and Dummies

Java for Geeks and Dummies

12th Grade - University

10 Qs

Java Classes

Java Classes

12th Grade - University

10 Qs

Structures and union

Structures and union

University

15 Qs

BASIC C PROGRAMMING QUIZ

BASIC C PROGRAMMING QUIZ

University

15 Qs

DS_NumPy_TEST1

DS_NumPy_TEST1

University

12 Qs

ENT110 C Programming Quiz2

ENT110 C Programming Quiz2

University

10 Qs

C++ Array Quick Review

C++ Array Quick Review

University

10 Qs

CS1010 Lab 4

CS1010 Lab 4

Assessment

Quiz

Computers

University

Hard

Created by

Gabriella Gloria

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index of the last element in a C array declared as int arr[10];?

0

1

9

10

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you initialize an array of size 5 in C?

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

int arr[] = [5];

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

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

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given an array arr[] = {10, 20, 30, 40}, what is the value of arr[1]?

10

20

30

40

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about arrays in C is true?

The size of an array can be changed after it is declared.

Array elements are stored in contiguous memory locations.

An array can hold multiple data types.

The array index starts from 1.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will happen if you try to access an element out of the bounds of an array?

Compilation error

Runtime error

The program will terminate with an error

Undefined behavior

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given an array int arr[3] = {10, 20, 30};, what will arr[3] access?

30

Compilation Error

0

Undefined Behavior

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the value stored in ptr?

The value of x

The memory address of x

10

Compilation error

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?