PHP Conditional Statements Quiz

PHP Conditional Statements Quiz

Professional Development

•

40 Qs

quiz-placeholder

Similar activities

Computer Forensics Quiz

Computer Forensics Quiz

Professional Development

•

40 Qs

Hackathon Behavioral and Technical Questions

Hackathon Behavioral and Technical Questions

Professional Development

•

45 Qs

CSS - Quiz 1

CSS - Quiz 1

Professional Development

•

40 Qs

CySA+Sy Test 04

CySA+Sy Test 04

Professional Development

•

43 Qs

Formative Assessment ITSS 06.011.2025

Formative Assessment ITSS 06.011.2025

Professional Development

•

40 Qs

html css js

html css js

Professional Development

•

35 Qs

Renforcement Quizz

Renforcement Quizz

Professional Development

•

40 Qs

HTML CSS

HTML CSS

Professional Development

•

41 Qs

PHP Conditional Statements Quiz

PHP Conditional Statements Quiz

Assessment

Quiz

•

Information Technology (IT)

•

Professional Development

•

Practice Problem

•

Hard

Created by

Cecilio Salonoy

Used 4+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

40 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the simplest form of a conditional statement in PHP?

if() else

if()

switch

elseif()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to compare values in a PHP conditional statement?

Arithmetic operator

Comparison operator

Logical operator

Assignment operator

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code if $grade = 80? if($grade < 75) { $remark = "Failed"; } else { $remark = "Passed"; }

"Failed"

"Passed"

No output

Error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which conditional statement allows multiple branches but executes only one true condition?

if()

if() else

if() elseif()

while()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the else statement in PHP?

To execute code when the if condition is true

To execute code when the if condition is false

To repeat a block of code

To define a function

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the value of $remark if $grade = 60? if($grade >= 90) { $remark = "Excellent"; } elseif($grade >= 75) { $remark = "Good"; } else { $remark = "Needs Improvement"; }

"Excellent"

"Good"

"Needs Improvement"

No output

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for an if() else statement?

if(condition) { code; } else(condition) { code; }

if(condition) { code; } else { code; }

if(condition) code; else code

if(condition) code; else(condition) code;

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?