CS1010 Lab 4

Quiz
•
Computers
•
University
•
Hard
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
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
Similar Resources on Wayground
10 questions
Talent Next Java MCQ-1

Quiz
•
University
15 questions
C Programming Output Quiz

Quiz
•
University
10 questions
C++ vs Python: A Quiz Introduction

Quiz
•
11th Grade - University
15 questions
JavaScript

Quiz
•
University
10 questions
Data Analytics using Python - Quiz 1

Quiz
•
University
11 questions
Array

Quiz
•
University
14 questions
Java Operators

Quiz
•
University
12 questions
C Basics

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University