Computer Science, asked by shanaz78605, 5 months ago

for ($ x=0; $ x<5; x++)

echo “Hai”

The above loop executes how many no of times?

a) 5

b) 4

c) 3

d) 2​

Answers

Answered by anindyaadhikari13
4

Answer:-

for($x = 0;$x<5;$x++)

echo "Hai"

The above code will run 5 times.

"Hai" will be printed 5 times. (PHP)

Answered by vinod04jangid
0

Answer:

5 times.

Explanation:

for($ x =0;$x < 5;$x++)

   echo "Hai"

OUTPUT:- Hai

                 Hai

                 Hai

                 Hai

                 Hai

The above code is a PHP code where we have used for loop to execute a particular statement multiple number of times. we have initialized x = 0 and then we check if x is less than 5 and it prints Hai every time after which the counter increments. So, Hai is printed 5 times that is for x =0, 1, 2, 3, 4 and then for x =5 when it checks the condition, it results to false and the loop stops.

#SPJ3

Similar questions