Every Book Back multiple-choice question from Loops in PHP (12th Standard Computer Applications, Samacheer Kalvi) — each with the correct option highlighted and a clear, worked explanation. Free to read in English and Tamil.
Q1
Which of the following is NOT a type of loop statement in PHP?
- A. for
- B. if ... elseCorrect
- C. while
- D. do … while
Explanation. The if ... else statement is a conditional statement used for decision-making in PHP, whereas for, while, and do ... while are looping structures used to execute a block of code repeatedly.
Q2
What type of loop is "for loop" in PHP?
- A. Entry-Check LoopCorrect
- B. Exit-Check Loop
- C. Counter Loop
- D. Iteration Loop
Explanation. A for loop in PHP is classified as an entry-check loop because the loop condition is evaluated at the beginning of each iteration before the code block is executed.
Q3
What is the syntax for for loop in PHP?
- A. for(initialization; condition; increment) { // code}Correct
- B. foreach(initialization; condition; decrement) { // code}
- C. while(condition)
- D. do{...}while(condition)
Explanation. The standard syntax for a for loop in PHP consists of three parameters: initialization, condition, and increment or decrement, enclosed in parentheses and followed by curly braces enclosing the code block.
Q4
What are the three parts of the for loop syntax in PHP?
- A. initialization, condition, incrementCorrect
- B. initialization, code block, condition
- C. code block, condition, increment
- D. condition, initialization, code block
Explanation. The three parameters in the parentheses of a PHP for loop syntax are the initialization of the variable, the evaluation condition, and the increment or decrement expression to update the variable.
Q5
When is the ‘initialization’ part of a for loop executed?
- A. Before each iteration
- B. After each iteration
- C. Only once at the beginning of the loopCorrect
- D. Only once at the end of the loop
Explanation. The initialization part of a PHP for loop is used to declare or set the starting value of loop control variables and is executed only once when the loop first starts.
Q6
What is the purpose of the ‘increment’ part of a for loop?
- A. To initialize variables
- B. To update variablesCorrect
- C. To check the condition
- D. To execute the code block
Explanation. The increment or decrement expression in a PHP for loop runs after the completion of each iteration to update the loop control variables, eventually causing the condition to become false.
Q7
What type of loop is “while loop” in PHP?
- A. Entry-Check LoopCorrect
- B. Exit-Check Loop
- C. Counter Loop
- D. Iteration Loop
Explanation. The while loop in PHP is an entry-check loop because it evaluates the test condition at the start of each iteration, executing the code block only if the condition is true.
Q8
What type of loop is “do...while loop” in PHP?
- A. Entry-Check Loop
- B. Exit-Check LoopCorrect
- C. Counter Loop
- D. Iteration Loop
Explanation. The do...while loop is called an exit-check loop because it executes the body of the loop first before testing the condition at the end of each iteration.
Q9
Which looping structure should be used to iterate over elements of an array in PHP?
- A. for loop
- B. while loop
- C. do...while loop
- D. foreach loopCorrect
Explanation. The foreach loop in PHP is designed specifically to easily traverse through the elements of an array without needing a manual counter or indexing variable.
Q10
What is the output of the following code?
\(array = array(1, 2, 3, 4, 5);
foreach (\)array as \(value)
{
echo \)value;
}
- A. 1 2 3 4 5Correct
- B. 5 4 3 2 1
- C. 1 1 1 1 1
- D. None of the above
Explanation. The foreach loop iterates through each element of the array from index zero to four, assigning each element's value sequentially to the variable \$value and displaying it.
About these Loops in PHP questions
These are the Book Back multiple-choice questions for Loops in PHP from the Tamil Nadu State Board (Samacheer Kalvi) 12th Standard Computer Applications syllabus. Each question shows the correct option and an original, step-by-step explanation so you understand the method, not just the answer. Use the answer key above to jump to any question, then take the practice test to check yourself under exam-like conditions.
Frequently asked questions
How many MCQs are there in Loops in PHP?
This chapter has 10 book-back multiple-choice questions, each with the correct answer and a step-by-step explanation.
Are these 12th Standard Computer Applications MCQs free to practise online?
Yes. Every question, answer and explanation here is free, and you can also take them as a timed practice test.
Where can I find the Loops in PHP book-back answers?
The correct option for each question is highlighted on this page with a worked explanation, plus a quick answer-key summary at the top.