![placeholder image to represent content](/_next/image?url=%2Fassets%2Fquiz_default_logo.jpg&w=256&q=75)
Number Handling
Quiz by Viji Gripsy PSGRKCW
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
- Q1
MCQ: What will be the result of the following PHP code?
$num1 = 10; $num2 = 3; $result = $num1 % $num2; echo $result;
3
0
1
2
30s - Q2
Which PHP function is used to find the absolute value of a number?
abs()
floor()
ceil()
round()
30s - Q3
What will be the output of the following PHP code?
$radius = 4; $area = M_PI * pow($radius, 2); echo round($area, 2);
50.2655
50.26
50
50.27
30s - Q4
Which PHP function is used to generate a random integer between a specified range (inclusive)?
mt_rand()
random_int()
rand()
random_bytes()
30s - Q5
What will be the value of $result after executing the following PHP code?
555
5
-5
55
30s - Q6
How can you calculate the factorial of a number 'n' in PHP?
factorial($n);
factorialOf($n);
Factorial cannot be calculated in PHP. (You need to define a custom function to calculate factorial.)
factorial_calc($n);
30s - Q7
Which operator is used for exponentiation in PHP?
**
//
##
^
30s - Q8
What will be the output of the following PHP code?
$numbers = [5, 10, 15, 20, 25]; $average = array_sum($numbers) / count($numbers); echo round($average, 2);
16
14
11
15
30s - Q9
What will be the result of the following PHP code?
$a = 5; $b = 2; $result = $a + $b * 2; echo $result;
9
5
10
7
30s - Q10
The rand() function in PHP returns:
A random float number between 0 and 1.
A random string of characters.
A random integer number between 0 and 100.
A random integer number between 0 and the largest possible integer value on the system.
30s