Need help with C++ triangle problem, simple hopefully

Hello

Trying to code this C++ program, in which it will let me know if the point is within this triangle or not - http://imgur.com/vOdbffL

Need help with the IF statement.

What I have -

if (x >= 0 && x <= 200);
{
if (y >= 0 && y <= -0.5 * x + 100);
{

inTheTriangle = true;

}
}




I know i'm probably doing the y wrong, i'm not the best with math..

Please help.

Thanks in advance
Last edited on
Semicolons. You have them in bad places. Study http://www.cplusplus.com/doc/tutorial/control/
Hi,

You will get the easy solutions for the different triangles programs, here is the link try this site.

It offers free Tutorials and Let Me Try online Editor for C, C++, C#, JAVA, HTML, CSS, JavaScript and more.

Check following link for your answer.

http://www.cbtsam.com/cppl2/cbtsam-cppl2-074.php

Last edited on
Topic archived. No new replies allowed.