Register|Login

Have a question? Click here to ask the community.

Quiz 11 – If Statements

| In: PHP Quizzes | 24,296 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



3 Responses to Quiz 11 – If Statements

Avatar

ian G.

August 2nd, 2016 at 8:44 am

well.. im doing good.. haha.. thanks a lot for this free tutorials… i actually learned here and definitely nothing in school.. ahahaha

Avatar

ian G.

August 2nd, 2016 at 8:45 am

got 100% 😀

Avatar

brooke

November 27th, 2016 at 5:27 pm

#3 does not offer the correct option. The correct answer is: Welcome to the USA

Comment Form

You must be logged in to post a comment.

Users Online

Users Online: 2 Users

Most Users Ever Online: 91

Quiz Scores

Advertisments