I can't seem to find the error in this code. I don't know if I constructed the codes correctly, assuming that the error is corrected, I could get the correct value?
/* Function for Right Triangle */
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define p printf
#define s scanf
double rightTriangle(double x, double y);
main()
{
double a,b;
double c;
p("Input the 2 lengths of the triangle:\n");
p("a="); s("%0.2f", &a);
p("b="); s("%0.2f", &b);
rightTriangle(a,b);
c=sqrt(rightTriangle(a,b));
p ("%0.2f", c);
getch();
return 0;
}
double rightTrangle(double x, double y)
{
return ((x*x) + (y*y));
}
I'm using Dev-C++...someone could make things clear to me, I'd really appreciate it ^_^