Please someone should debug this program.

i'm having some issues debugging this program. can someone do that for me. please

/* A program that calculates
the area of a triangle using
three distinct formulas*/

#include <iostream>
#include <cmath>

using namespace std;

int areaOfTriangle(); // user-defined function prototype

int main()
{
areaOfTriangle();
return 0;
}

int areaOfTriangle() //user-defined function
{
float A; // variable declaration for side A
float C; // variable declaration for side C
float B; // variable declaration for breathe
float H; // variable declaration for Height
float X; // variable declaration for included angle in the triangle
int Area;
float S = (A + B + C)/2;
int ch;

cout << " MENU:\n please select the following options below\n "; // output stream object for interactive usage of program
cout << " n1. Option 1 [Hint]: A= 1/2 * B * H\n";
cout << " n2. Option 2 [Hint]: A = ABcosX\n";
cout << " n3. Option 3 [Hint]: A = squareroot of S(S-A)(S-B)(S-C)\n";

cin >> ch; // input stream object to enable user choose options

switch(ch)
{
case 1:
{
cout << "plese enter values for sides B and H: ";
cin >> B;
cin >> H;
Area = 0.5 * B * H;
break;

}

case 2:
{
cout << "Please enter values for sides A and B and the included angle: ";
cin >> A;
cin >> B;
cin >> X;
Area = A * B *cos(X);
break;
}
case 3:
{
cout << "Please enter values for A, B and C: ";
cin >> A;
cin >> B;
cin >> C;
S = (A + B + C)/2;
Area = sqrt(S*(S-A)*(S-B)*(S-C));
break;
}
default: cout << "The option chosen is a wrong one. please read the instructions and follow suit ";
break;
}

cout << "The area of the triangle is: " << Area;

}
How are you having issues debugging it? What is the problem? What is it that is not working intentionally? You should learn how to debug yourself, it's pretty useful.

Also, please put all of your code in code tags - http://www.cplusplus.com/articles/jEywvCM9/
Well i have debugged it on my own and dont see any issues...but on running the program no matter the option i choose the area is zero
int Area; // try changing it to float
i did that already....its now working....thanks for you time @TarikNeaj
Topic archived. No new replies allowed.