Round 3 Quiz
Round 3 Quiz
Round 3 Quiz
COMPETITION
ROUND 3
1)Which of the following is a feature of
object-oriented programming?
A) Encapsulation
B) Compilation
C) Interpretation
D) Input/Output
2)What type of error occurs when you try to
access an index that is out of bounds in an
array?
A) Syntax error
B) Logical error
C) Runtime error
D) Compilation error
3)What will the following SQL statement return?
SELECT COUNT(*) FROM employees WHERE department = 'Sales';
A) 5
B) 10
C) 0
D) Error
6)In Java, what does the following code
produce?
public class Test {
public static void main(String[] args) {
int[] arr = new int[5];
System.out.println(arr[5]); }
}
A) 0
B) 5
C) ArrayIndexOutOfBoundsException
D) Compilation error
7)What is the output of the following C code?
#include <stdio.h>
int main() {
int x = 10;
printf("%d\n", x++);
return 0;
}
A) 10
B) 11
C) Error
D) 0
8)What will the following SQL query return?
A) 3
B) Error
C) Undefined
D) 0
12)What will be the output of the following Java code?
public class Test {
public static void main(String[] args) {
String str = "Hello";
str.concat(" World");
System.out.println(str);
}
}
A) Hello
B) Hello World
C) Error
D) HelloWorld
13)In the following C code, what kind of error is present?
#include <stdio.h>
int main() {
int x = 10;
printf("%d\n", x/0);
return 0; }
A) Syntax error
B) Logical error
C) Runtime error
D) Compilation error
14)What will happen if you run the following C# code?
class Program {
static void Main() {
int[] arr = new int[3];
Console.WriteLine(arr[3]);
}}
A) 0
B) 3
C) IndexOutOfRangeException
D) Compilation error
15) What type of error does the
following SQL statement produce?
INSERT INTO employees (id,
name) VALUES (1, 'John'), (1,
'Doe');