Romanchuk_2 - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of Romanchuk_2.php

  1. <?php //Вычисления
  2. echo "Вычисления";
  3. ?>
  4.  
  5. <?php //задание 1
  6. $a = max(4, -2, 5, 19, -130, 0, 10);
  7. $b = min(4, -2, 5, 19, -130, 0, 10);
  8. echo "Задание 1 - ($a$b)";
  9. ?>
  10.  
  11. <?php // задание 2
  12. $a = 17;
  13. $b = 10;
  14. $c = $a - $b;
  15. $d = 7;
  16. $result = $c + $d;
  17. echo "Задание 2 - ($result)";
  18. ?>
  19.  
  20. <?php //задание 3
  21. echo "Задание 3 - ceil - ", ceil(sqrt(9.9)),"floor - ", floor(sqrt(9.9));;
  22. ?>
  23.  
  24. <?php //задание 4
  25. $x = rand(-10, 10);
  26. $y = rand(-10, 10);
  27. $z = rand(-10, 10);
  28. $result = (($x + 1)^4 - 2*($z - 2*$x^2 + $y^2) + sqrt(abs(sin($y))));
  29. echo "Задание 4 - $result"
  30. ?>
  31.  
  32. <?php //задание 5
  33. $x = rand(-10, 10);
  34. $y = rand(-10, 10);
  35. $z = rand(-10, 10);
  36. $result = ($x^2 - (4 * sqrt($y - 1)))/(sin(2 * $x) + abs($x));
  37. echo "Задание 5 - $result"
  38. ?>
  39.  
  40. <?php //задание 6
  41. $a = rand(-10, 10);
  42. $b = rand(-10, 10);
  43. $c = rand(-10, 10);
  44. $x = (($a / $c) * ($b / $d)) - (($a * $b - $c)/($c * $d));
  45. echo "Задание 6 - $x"
  46. ?>
  47.  
  48. <?php //задание 7
  49. $x = rand(-10, 10);
  50. $y = ((2 * sin($x)) + (cos($x/2)))/(3 + (1 + cos(2 * $x)/2));
  51. echo "Задание 7 - $y"
  52. ?>
  53.  
  54. <?php //задание 8
  55. $x = rand (-10, 10);
  56. $result = abs($x^2/$x^3) - (7*$x)/($x^3 - (15*$x));
  57. echo "Задание 8 - $result"
  58. ?>
  59.  
  60. <?php //задание 9
  61. $a = rand(-10, 10);
  62. $b = rand(-10, 10);
  63. $c = rand(-10, 10);
  64. $result = ((($b + sqrt($b^2 + 4*$a*$c))/(2*$a)) - (($a^3*$c) + $b^-2));
  65. echo "Задание 9 - $result"
  66. ?>
  67.  
  68. <?php //задание 10
  69. $hour = 60*1;
  70. $day = 60*24;
  71. $month = 60*(24*30);
  72. echo "Секунд в часе - $hour ; В сутках - $day ; В месяце - $month";
  73. ?>
  74.  
  75.  
  76.  
  77.  
File Description
  • Romanchuk_2
  • PHP Code
  • 25 Sep-2022
  • 1.6 Kb
You can Share it: