
c++ arrays
Authored by Lakshmi B
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
undefined
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the index of the first element in an array?
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Machine Learning (Introduction)
Quiz
•
University
11 questions
Determining System Requirements
Quiz
•
University
15 questions
1.1.1 The structure and function of the processor
Quiz
•
11th Grade - University
10 questions
Planning and Implementation of Information Security
Quiz
•
University
10 questions
INTO Artificial Intelligence
Quiz
•
University - Professi...
14 questions
ITF Chapter 1 Computing Devices
Quiz
•
University
10 questions
INTRODUCCION A LA PROGRAMACION
Quiz
•
6th Grade - University
10 questions
Let's Play Together
Quiz
•
University - Professi...
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade