TN Online TestSamacheer Kalvi practice

12th Standard Computer Applications — Conditional Statements in PHP: Book Back MCQs with Answers & Explanations

Share this chapter: Telegram

Every Book Back multiple-choice question from Conditional Statements 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.

Answer key at a glance

Q1
Which of the following is NOT a type of conditional statement in PHP?
  • A. if
  • B. if ... else
  • C. if ... elseif ... else
  • D. whileCorrect
Explanation. In PHP, while is a looping statement used to repeat a block of code, whereas if, if-else, and if-elseif-else are conditional structures used for decision making.
Q2
What type of statement is the if...else statement?
  • A. Conditional statementCorrect
  • B. Looping
  • C. Input statement
  • D. Output statement
Explanation. The if...else statement is classified as a conditional statement because it executes a specific block of code depending on whether a given test expression is true or false.
Q3
What is the simplest conditional statement in PHP?
  • A. if-else statement
  • B. if statementCorrect
  • C. switch statement
  • D. if-elseif-else statement
Explanation. The basic if statement is the most straightforward decision-making construct in PHP since it only checks one condition and executes a block if that condition is true.
Q4
How does the if statement work in PHP?
  • A. A block of code is executed if a certain condition is true.Correct
  • B. A block of code is executed if a certain condition is false.
  • C. A block of code is executed if multiple conditions are true.
  • D. A block of code is executed if multiple conditions are false.
Explanation. In PHP, the if statement is designed to execute a block of code only when the specified boolean condition evaluates to true.
Q5
What happens if the condition in an "if" statement is false?
  • A. The code inside the curly braces is executed.
  • B. The code inside the curly braces is skipped.Correct
  • C. The program terminates.
  • D. None of the above
Explanation. When the conditional expression in an if block resolves to false, the subsequent code inside the curly braces is ignored, and the program execution continues with the next statement.
Q6
What is the syntax for an if-else statement in PHP?
  • A. if(condition) { //True-block; }
  • B. if(condition) { //True-block; } else { //False-block; }Correct
  • C. if-else(condition) { //True-block; } else { //False-block; }
  • D. if-elseif(condition) { //True-block; } else { //False-block; }
Explanation. The proper syntax combines the if block, which contains the code to execute on a true condition, with the else block, which contains code for a false condition.
Q7
Which of the following is used to specify multiple conditions in an if ... elseif ... else statement?
  • A. AND
  • B. OR
  • C. case
  • D. elseifCorrect
Explanation. The elseif clause is utilized within conditional blocks to execute different pieces of code by defining subsequent test conditions if previous ones are false.
Q8
Which of the following is used to specify multiple conditions in a switch statement?
  • A. AND
  • B. OR
  • C. caseCorrect
  • D. if
Explanation. In a PHP switch block, multiple execution paths are designated using case labels, each defining a value to be compared against the target expression.
Q9
What happens if none of the case values match the expression in a switch statement?
  • A. The default case block is executedCorrect
  • B. The program terminates
  • C. The nearest case block is executed
  • D. The first case block is executed
Explanation. The default statement in a switch block acts as a fallback. It is executed if none of the explicit case statements match the evaluated expression value.
Q10
Which of the following is used to terminate the switch statement?
  • A. return
  • B. continue
  • C. goto
  • D. breakCorrect
Explanation. The break statement stops the execution flow inside a switch block, preventing it from executing statements in subsequent cases.
Take the Book Back practice test → Open the app

More for this chapter

Additional MCQs15 extra MCQs · solved Practice TestInteractive · instant score Book Back TestTest yourself on the textbook set Additional MCQ TestTest yourself on the extra set Study NotesConcepts & methods Formula SheetAll key formulas

About these Conditional Statements in PHP questions

These are the Book Back multiple-choice questions for Conditional Statements 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 Conditional Statements 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 Conditional Statements 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.

More chapters in Computer Applications

View all
1 Multimedia 2 An Introduction to Adobe PageMaker 3 Introduction to Database Management System 4 PHP: Hypertext Preprocessor 5 Functions and Arrays in PHP 7 Loops in PHP 8 Forms and Files 9 Connecting PHP and MYSQL 10 Introduction to Computer Networks 11 Network Examples and Protocols 12 Domain Name System (DNS) 13 Network Cabling 14 Open Source Concepts 15 E-Commerce 16 Electronic Payment Systems 17 E-Commerce Security Systems 18 Electronic Data Interchange- EDI