Arrays
Control Structures
Functions
Other Languages
General Knowledge
200

What is the index of the first element of an array?

0

200

What keyword is used to create a conditional branch in C?

If

200

What is the keyword used to define that a function does not return a value?

void

200

What does this Python code do

num1 = float(input("Enter the first number: "))
num2 = float(input("Enter the second number: "))
if num1 > num2:
    print(f"The first number ({num1}) is greater than the second number ({num2}).")
elif num2 > num1:
    print(f"The second number ({num2}) is greater than the first number ({num1}).")
else:
    print("Both numbers are equal.")

Get 2 numbers from the user and determines which is greater

200

What is the most recent iPhone released?

iPhone 16
400

What happens when you send an array to a function and change a value in the array?

That value is changed for that array everywhere in the program.
400

Which keyword allows you to skip the current iteration of a loop?

continue

400

What is the term for passing arguments to a function that is a copy of what is sent? 

pass by value

400

What does this C++ code do

#include 
int main() {
    int number;
    std::cout << "Enter a integer: ";
    std::cin >> number;
        int result = 1;
    for (int i = 1; i <= n; ++i) {
        result *= i;
    }
        std::cout << result << std::endl;
    return 0;
}

Finds the factorial of the number input by the user

400

Who won the World Series this year for MLB?

Los Angelos Dodgers

600

If you have a string in C, what built in function would you use to find the length? How does this function find the length?

strlen

it counts the number of characters until it hits a \0 

600

When inside of a loop, what keyword allows you to forcefully exit the loop?

break

600

What is a function definition?

The code that is run when the function is called.

600

What does this Onyx code do?

use core {*}
main :: () {
    n := read_line() |> conv.parse(u32, _)!
    v := 0
    for i in 1 ..= n do v += i
    printf("Value: {}\n", v)
}

Finds the sum from 0 until (and including) the number input by the user

600

What year was Minecraft fully released?

November 18, 2011

800

When sending a multidimensional array to a function, why are you required to specific all dimension sizes except the leftmost one?

Since all arrays in memory are single dimension arrays, the function needs to know how far to jump forward in that list. 

800

Which type of loop guarantees that at least one iteration will occur?

do-while

800

What is the term for the pieces of information sent to a function?

parameters

800

What does this Elixir code do / output

IO.gets("> ")
  |> String.trim()
  |> String.split(" ")
  |> Enum.map(&String.to_integer/1)
  |> Enum.max()
  |> IO.puts()

User types in a list of numbers that are space separated and the program outputs the max

800

In League of Legends lore, who is Kai'sa's father?

Kassadin

1000

When passing an array to a function, what is actually passed to the function instead of the entire array itself?

A pointer to the first element in the array

1000
If you have a nested loop, how do you exit both loops?
goto statement
1000

What is a recursive function

a function that calls itself

1000

What does this Haskell code output

foo :: [Int] -> Int 
foo [] = 0 
foo (x:xs) = x + foo xs 
main :: IO () 
main = do 
  let numbers = [1, 2, 3, 4, 5] 
  print (foo numbers)

prints the sum of the numbers (15)

1000

What does the Jake Jake no Mi fruit allow the user to do in One Piece?

Become a jacket and be worn by others.