Quiz Answer Key and Fun Facts
1. In the context of computer programming what is a loop?
2. In many languages, including C, the body of a loop must be enclosed by what character?
3. Sometimes the programmer may wish the loop to stop before it has finished executing completely. What word is used in many languages, including Javascript, to end the loop early?
4. When writing a loop in the Python programming language each line of the content of the loop must be indented by the same amount.
5. In the language Ruby, which command can be used to tell the program that the loop body has finished?
6. When creating a loop, the programmer usually needs to be careful that their loop does not run forever. What is the term used to describe a loop which does not stop?
7. Instead of using a for loop to work through items in a collection the language Java has a built in method that can be used instead. What is this method called?
8. The language PHP, amongst others, has a loop known as a 'do ... while' loop. How does this differ from a regular 'while' loop?
9. A for loop in the COBOL language starts with which statement?
10. In which of the following languages does a possible syntax for creating a loop include the keyword 'LOOP'?
Source: Author
The_Cyclist
This quiz was reviewed by FunTrivia editor
rossian before going online.
Any errors found in FunTrivia content are routinely corrected through our feedback system.