adplus-dvertising
frame-decoration

Question

What will be the output of the following PHP code ?
<?php
for ($x = 0; $x <= 10; $x++)
{
    echo "The number is: $x <br>";
}
?>

a.

The number is: 0
The number is: 1
The number is: 2
The number is: 3
The number is: 4
The number is: 5
The number is: 6
The number is: 7
The number is: 8
The number is: 9
The number is: 10

b.

The number is: 0

c.

no output

d.

error

Answer: (a).The number is: 0
The number is: 1
The number is: 2
The number is: 3
The number is: 4
The number is: 5
The number is: 6
The number is: 7
The number is: 8
The number is: 9
The number is: 10

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following PHP code ?