Why is the result always 0? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
+ 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
5 Respostas
+ 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
`Š½ŃŃįØā“ā°ā¶
+ 1
No it is to calculate the circel area inscribed in an isosceles triangel
23rd Apr 2024, 12:14 PM
āHasan Abouorra
+ 1
Very attentive and clever! Thank you!
23rd Apr 2024, 12:25 PM
āHasan Abouorra
+ 1
You're welcome š
23rd Apr 2024, 12:32 PM
piano T
Quente hoje
TIMER