fork download
  1. <?php
  2. /*This is my PHP code*/
  3. define('K','');
  4. define('L','');
  5. $x=0.0;
  6. $a=0.0;
  7. $b=0.0;
  8. $y=0.0;
  9. echo("Please enter value for X\n");
  10. $x=(float)readline();
  11. echo("x=".$x."\n");
  12. $part1=$K**(0.5);
  13. $part2 = sqrt($x+2.84);
  14. $part3 = $L*$part2;
  15. echo("$Part1=".$part1."\n");
  16. echo("$Part2=".$part2."\n");
  17. echo("$Part2=".$part2."\n");
  18. $a=($part1 - $part3)**2;
  19. echo("Result is A=".$a."\n");
  20. $b=-log10($x)*exp($x);
  21. echo("Result is B=".$b."\n");
  22. if (a>b){
  23. $y=(4*$a+3*$b)/(pow($a,2)+pow($b,2));
  24. }
  25. if (a<=b){
  26. $y=abs($a-$b);
  27. }
  28. echo("Final result is Y=".$y."\n");
  29. ?>
Success #stdin #stdout #stderr 0.03s 26580KB
stdin
0.234
stdout
Please enter value for X
x=0.234
=0
=1.7532826355154
=1.7532826355154
Result is A=0
Result is B=0.79708690755568
Final result is Y=0.79708690755568
stderr
PHP Notice:  Undefined variable: K in /home/m7QQWo/prog.php on line 12
PHP Notice:  Undefined variable: L in /home/m7QQWo/prog.php on line 14
PHP Notice:  Undefined variable: Part1 in /home/m7QQWo/prog.php on line 15
PHP Notice:  Undefined variable: Part2 in /home/m7QQWo/prog.php on line 16
PHP Notice:  Undefined variable: Part2 in /home/m7QQWo/prog.php on line 17
PHP Warning:  Use of undefined constant a - assumed 'a' (this will throw an Error in a future version of PHP) in /home/m7QQWo/prog.php on line 22
PHP Warning:  Use of undefined constant b - assumed 'b' (this will throw an Error in a future version of PHP) in /home/m7QQWo/prog.php on line 22
PHP Warning:  Use of undefined constant a - assumed 'a' (this will throw an Error in a future version of PHP) in /home/m7QQWo/prog.php on line 25
PHP Warning:  Use of undefined constant b - assumed 'b' (this will throw an Error in a future version of PHP) in /home/m7QQWo/prog.php on line 25