Why is the result always 0? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

Why is the result always 0?

Can someone tell what I did wrong? I did try a =20 and b = 10, the result should be 47, 1.. ButI get always zero:( https://sololearn.com/compiler-playground/csH0Ot48654D/?ref=app

23rd Apr 2024, 11:50 AM
‎Hasan Abouorra
‎Hasan Abouorra - avatar
5 Respuestas
+ 2
You should use floating-point numbers rather than integers. this: ' float Area = pi * ((b * b) / 4.0) * ((2.0 * a - b) / (2.0 * a + b));' ?
23rd Apr 2024, 12:17 PM
piano T
+ 1
Check your user define function, it is the area of an ellipse, right? This is the correct user define function will be for the area of an Ellipse: float Area = pi * a * b / 4 * (2.0 - ((a - b) * (a - b)) / ((a * a) + (b * b)));
23rd Apr 2024, 12:08 PM
`нттp⁴⁰⁶
`нттp⁴⁰⁶ - avatar
+ 1
No it is to calculate the circel area inscribed in an isosceles triangel
23rd Apr 2024, 12:14 PM
‎Hasan Abouorra
‎Hasan Abouorra - avatar
+ 1
Very attentive and clever! Thank you!
23rd Apr 2024, 12:25 PM
‎Hasan Abouorra
‎Hasan Abouorra - avatar
+ 1
You're welcome 🙂
23rd Apr 2024, 12:32 PM
piano T