#include <iostream>
#include <string>
using namespace std;
void ReadTriangleLegs(float& a, float& b)
{
cout << "Please enter Triangle Leg 1 : ";
cin >> a;
cout << "Please enter Triangle Leg 2 : ";
cin >> b;
}
float CalculateCircleArea(float a, float b)
{
const float PI = 3.14159265359;
float Area = PI * (pow(b, 2) / 4) * ((2 * a - b) / (2 * a + b));
return Area;
}
void PrintResults(float Area)
{
cout << "The Circle Area is : " << Area << endl;
}
int main()
{
float a, b;
ReadTriangleLegs(a, b);
PrintResults(CalculateCircleArea(a, b));
return 0;
}
This is a code to calculate a circle area Inscribed in an Isosceles Triangle and I want to know why when I change the variable type for (a & b) from float to int I get Area = 0 ?