1 && $x<10){ $y=tan($x-1); } else if ($x<=-1 ||$x>=10){ $y=1; } else{ $y="Wrong value of x!"; } return($y); } echo "Result of first task is: ".task1(2)."
"; //task 2 function task2(){ //subtask a echo "Result of second task (a) is: "."
"; $x=0; while($x<=0.4){ $z=(asin(2*$x)+abs($x))/($x*$x+1); echo $z."
"; $x+=0.2; } //subtask b echo "Result of second task (b) is: "."
"; $x=0.1; for($i=0;$i<6;$i++){ $z=(asin(2*$x)+abs($x))/($x*$x+1); echo $z."
"; $x+=0.05; } } task2(); //task 3 function task3(){ $S=0; echo "Result of third task is: "."
"; for($l=3;$l<=13;$l++){ $S+=pow(-1,$l)*($l*$l+1)/($l+2); } echo $S."
"; $p=1; $k=3; $n=8; for ($i=$k; $i<=$n; $i++){ $p*=($i-1)/($i*$i+5); } echo $p."
"; } task3(); //task 4 function task4($array){ $maxAbs=abs($array[0]); for($i=1;$i$maxAbs){ $maxAbs=$array[$i]; } } return $maxAbs; } $c=[-3.6,-5.3,2.1,0.1,-0.7,5.3,6.6,2.2]; echo "Result of fourth task is: ".task4($c)."
"; ?>