if, else, and elseifif statement do in Lua?
if block?
elseifelseelseifelsethenif condition evaluate to in Lua?
true or false)if–elseif block are true?
else block is executedif block is retriedif condition?
thendoendelseifelseif be used without an else block?
if statements structured in Lua?
if must have its own endtruefalsenilwhile, repeat...until, and forwhile loop do in Lua?
falsewhileforrepeat...untilifrepeat...until loop terminated?
breaktruefalseforwhiledoinfor loop?
102for loop?
end to terminatewhile loops be nested in Lua?
do blocksrepeat...until loop with a true condition do?
while and repeat...until?
while executes at least oncerepeat...until executes at least oncewhile doesn’t require conditionsbreak and returnbreak statement do in Lua?
break be used outside of a loop in Lua?
break is executed in a while loop?
return statement be used in Lua?
ifreturn do in a function?
return statement provide?
break and return be used together?
break?
repeat...untilifreturn terminate the function immediately?
endreturn is used without a value?
nil0break be used in nested loops?
breakreturnos.exit()stopbreak and return have conditions in Lua?
if statementsbreak can have conditionsreturn can have conditions| Qno | Answer |
|---|---|
| 1 | b) Executes a block if a condition is true |
| 2 | b) else |
| 3 | a) Boolean (true or false) |
| 4 | b) The else block is executed |
| 5 | a) then |
| 6 | a) Yes |
| 7 | b) Each if must have its own end |
| 8 | b) false |
| 9 | a) Executes until the condition becomes false |
| 10 | c) repeat...until |
| 11 | b) When the condition evaluates to true |
| 12 | a) for |
| 13 | a) 1 |
| 14 | c) Executes at least once |
| 15 | b) Yes, with separate conditions |
| 16 | b) Cause an infinite loop |
| 17 | b) repeat...until executes at least once |
| 18 | a) Exits a loop immediately |
| 19 | b) No |
| 20 | a) The loop terminates |
| 21 | b) Only in functions |
| 22 | a) Ends the function execution and returns a value |
| 23 | c) Unlimited |
| 24 | b) Yes, but only in loops |
| 25 | a) Inside repeat...until |
| 26 | a) Yes, always |
| 27 | a) Returns nil |
| 28 | a) Yes, but only exits the inner loop |
| 29 | c) os.exit() |
| 30 | a) Yes, with if statements |