Self-Test Questions in PHP Language For Beginners Part 5


1. What are the four basic arithmetic operators and the symbols used for them in PHP?
2. Which operators are used for incrementing and decrementing variables?
3. What is the difference between pre- and post-incrementing and decrementing?
4. What is the modulus operator symbol, and what does it do?
5. With which function can you return a number as a non-negative value, regardless of whether it is positive or negative?
6. Given a numeric variable called $v that may have a negative, zero, or positive value, which math function out of min() or max() can be used (and how) to replace any negative value with 0, but leave a positive value untouched?
7. How can you obtain a pseudo-random number between 1 and 100, inclusive?
8. How can you combine the mathematical addition operator with the assignment operator to create a shorter expression than, for example, $a = $a + 23;?
9. If $a has the value 58, what will the expression $a /= 2; evaluate to?
10. How can you set the variable $n to contain the remainder after dividing it by 11?

Self-Test Questions in PHP Language For Beginners Part 5

No comments:

Post a Comment