Doğru Cevap
-
++ redbull330@hotmail.com ++
#0dan 5e kadar bir for döngüsü tanimliyoruz
#dikkat 0.5 araliklar ile artiyor for döngümüz
#if else bloglarini istenen x degerlerine göre ayarliyoruz
#pow(x,y) xin y. üstü fonksiyonu
#print sonucu ekrana yaziyor toString()
for($x=0; $x<=5; $x+=0.5){ if($x<=1){ echo $x; echo ""; }else if($x<=3){ print("f(".$x.")= ".(pow($x,4)-pow($x,3)+pow($x,2))); echo ""; }else if($x<=4){ print("f(".$x.")= ".(pow($x,2)-(5*$x)-8)); echo ""; } else if($x<=5){ print("f(".$x.")= ".(pow($x,6)-(5*(pow($x,3)))+8)); echo ""; } }
#cikti örnegi:
0
0.5
1
f(1.5)= 3.9375
f(2)= 12
f(2.5)= 29.6875
f(3)= 63
f(3.5)= -13.25
f(4)= -12
f(4.5)= 7856.140625
f(5)= 15008
#ps: program php dilinde
sana c++ lazimdi tüm dillerde
for ile pow ayni sadece ekrana yazdirma
ile variable tanimlarini c++ göre degistireceksin
umarim o kadarini da yaparsin :)
Cevaplar
Hiç cevap bulunamadı.