
SWE111_quiz 2
Authored by Riham KamalAbdelAziz
Information Technology (IT)
University
Used 3+ 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 is the correct way to declare an array in C++?
int arr[];
array<int> arr;
int arr[5];
arr = new int[5];
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax to initialize an array?
int arr[3] = {1, 2, 3};
int arr = {1, 2, 3};
int arr[] = [1, 2, 3];
int arr[3] {1, 2, 3};
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access the last element of an array arr of size n?
arr[n]
arr[n-1]
arr[-1]
arr[last]
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens when an array is passed to a function?
A copy of the array is created
The base address of the array is passed
The function cannot modify the array
It results in a syntax error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given int arr[5] = {1, 2, 3, 4, 5};, what does cout << arr; print?
The first element
The address of the first element
The entire array
Compilation error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can an array size be changed after declaration in C++?
Yes
No
Only for global arrays
Depends on compiler
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code fragment:
int ar[] = {2, 4, 6, 8 };
ar[0] = 23;
ar[3] = ar[1];
cout << ar[0]<< "and" <<ar[3] << endl;
23 and 2
2 and 8
3 and 1
23 and 4
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
15 questions
ViewSonic LCD Training
Quiz
•
12th Grade - University
10 questions
Chapter 8: Developing Business IT Solutions
Quiz
•
University
12 questions
QUIZ KEJAHATAN DUNIA MAYA
Quiz
•
University
10 questions
Data Visualization with Qlik Cloud
Quiz
•
University
14 questions
Game dulu sebelum QUIZ 1
Quiz
•
University
10 questions
Multimedia Networking Quiz
Quiz
•
University
15 questions
Mobile Programming - POCC
Quiz
•
University
15 questions
DBMS Group 8 Review Quiz
Quiz
•
University
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
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
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Information Technology (IT)
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
5 questions
Poetry Interpretation
Interactive video
•
4th Grade - University
19 questions
Black History Month Trivia
Quiz
•
6th Grade - Professio...
15 questions
Review1
Quiz
•
University
15 questions
Pre1
Quiz
•
University