Examveda
Examveda

What will be the output of the following PHP code ?
<?php
for ($count = 1; $count != 20;$count++)
{
    print $count;
    $count++;
}
?>

A. Infinite

B. 123…….20

C. 1357…19

D. 13579…21

Answer: Option A

Solution(By Examveda Team)

Condition always fails as count takes only odd numbers.

This Question Belongs to PHP >> Control Structures(Loop In PHP)

Join The Discussion

Related Questions on Control Structures(Loop in PHP)