CSE 110 exam 3 multiple choice |97 questions| with correct answers
1) Consider the following line of code: int[] somearray = new int[30]; Which one of the following options is a valid line of code for displaying the twenty-eighth element of somearray? a) Sln(somearray[28]); b) Sln(somearray(28)); c) Sln(somearray(27)); d) Sln(somearray[27]); CORRECT ANSWER d Identify the correct statement for defining an integer array named numarray of ten elements. a) int[] numarray = new int[9]; b) int[] numarray = new int[10]; c) int[10] numarray; d) int numarray[10]; CORRECT ANSWER b Which one of the following statements is a valid initialization of an array named somearray of ten elements? a) int[] somearray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; b) int somearray[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; c) int[10] somearray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; d) int somearray[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; CORRECT ANSWER a
Written for
- Institution
-
Arizona State University
- Course
-
CSE 110
Document information
- Uploaded on
- March 4, 2023
- Number of pages
- 54
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cse 110 exam 3 multiple choice |97 questions| with correct answers
Also available in package deal