Multiple Choice
What is displayed after executing the given code snippet?
Int[] mymarks = new int[10];
Int total = 0;
Scanner in = new Scanner(System.in) ;
For (int cnt = 1; cnt <= 10; cnt++)
{
System.out.print("Enter the marks: ") ;
Mymarks[cnt] = in.nextInt() ;
Total = total + mymarks[cnt];
}
System.out.println(total) ;
A) The code snippet displays the total marks of all ten subjects.
B) The for loop causes a run-time time error on the first iteration.
C) The code snippet causes a bounds error.
D) The code snippet displays zero.
Correct Answer:

Verified
Correct Answer:
Verified
Q18: It may be necessary to "grow" an
Q21: Consider the following code snippet:<br>String[] data =
Q34: What will be printed by the statements
Q35: Which code snippet finds the largest value
Q36: What is the output of the following
Q39: How many elements can be stored in
Q41: Consider the following code snippet:<br>Int[][] arr =<br>{<br>{
Q42: Babbage's machine for automatically producing printed tables
Q43: Which one of the following is the
Q107: When the order of the elements is