Web-II-Loop and Function

Quiz
•
Computers
•
University
•
Hard
Tamal Dey
Used 32+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following PHP code ?
<?php
$i = 0;
for ($i)
{
print $i;
}
?>
0
infinite loop
no output
error
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following PHP code ?
<?php
for ($x = 1; $x < 10;++$x)
{
print "*\t";
}
?>
**********
*********
***********
infinite loop
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following PHP code ?
<?php
for ($x = -1; $x < 10;--$x)
{
print $x;
}
?>
123456789101112
12345678910
1234567891011
infinite loop
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following PHP code ?
<?php
$x;
for ($x = -3; $x < -5; ++$x)
{
print ++$x;
}
?>
-3-4-5
-3-4
no output
infinite loop
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What will be the output of the following PHP code ?
<?php
for ($x = 1; $x < 10; $x++)
for ($y = 1; $y < 5; $y++)
print "Hello";
?>
Hello....36 times
Hello....45 times
Hello....50 times
Hello....40 times
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will happen in this function call?
<?php
function calc($price, $tax)
{ $total = $price + $tax;
}
$pricetag = 15;
$taxtag = 3;
calc($pricetag, $taxtag);
?>
Type Hinting
Default Argument Value
Call By Value
Call By Reference
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following PHP code?
<?php
function calc($price, $tax="")
{
$total = $price + ($price * $tax);
echo "$total";
}
calc(42);
?>
error
0
42
84
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Web - TRPL 7C

Quiz
•
11th Grade - University
15 questions
Python-Day-3

Quiz
•
12th Grade - University
12 questions
Programação Web - PHP

Quiz
•
University
15 questions
ASK F2 -KOD ARAHAN (PYTHON)

Quiz
•
1st Grade - University
10 questions
Python - Functions

Quiz
•
University
7 questions
PHP + MySql (1)

Quiz
•
University
10 questions
2025 python class first quiz

Quiz
•
9th Grade - University
10 questions
Flutter Test 1

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University