Senior Secondary · 11-12 · Programming
What is a function in programming?
A reusable block of code that performs a specific task, which can accept inputs (parameters) and optionally give back a result (return value)
What does the 'return' keyword do in a function?
It sends a value back to wherever the function was called, ending the function's execution
What is a parameter in a function definition?
A named input variable that a function accepts when it's called
What is a nested loop?
A loop placed inside another loop — the inner loop runs completely for every single iteration of the outer loop
If an outer loop runs 3 times and an inner loop inside it runs 4 times on each pass, how many total iterations does the inner loop run?
12 (3 × 4)
Free, offline, no account needed — runs entirely in your browser.