Register|Login

Have a question? Click here to ask the community.

Quiz 11 – If Statements

| In: PHP Quizzes | 22,048 views

*You are currently not logged in and your quiz score will not be recorded. Please login or register if you would like to submit your quiz score.

Directions: Answer all questions. Any questions skipped will be scored as wrong answers. Good Luck! :)

1. What will be displayed in a browser when the following PHP code is executed:

<?php
   if (8 >= 7) {
       echo "Hello World";
   }
?>

Hello World
Nothing Will Be Displayed

2. The PHP If Statement will only execute the code within it’s curly braces if the if condition is FALSE?

True
False

3. What will be displayed in a browser when the following PHP code is executed:

<?php
   if ("Tom" == "Rose") {
       echo "Hello World";
   }

   echo "Welcome to the USA";
?>

Hello World
Welcome to the USA

Welcome to the USA
Hello World

Tom is in love with Rose
Welcome to the USA

4. What will be displayed in a browser when the following PHP code is executed:

<?php
   if (8 >= 7 && "Tom" == "Rose") {
       echo "Hello World";
   }
?>

Hello World
Nothing Will Be Displayed

5. What will be displayed in a browser when the following PHP code is executed:

<?php
   if (8 >= 7 || "Tom" == "Rose") {
       echo "Hello World";
   }
?>

Hello World
Nothing Will Be Displayed

Comment Form

You must be logged in to post a comment.

Users Online

Users Online: 6 Users

Most Users Ever Online: 91

Quiz Scores

Advertisments