ok this code gets three sides of a triangle and prints out the area... but it just prints out that the area is 0 every time... why?
#include <stdio.h>
#include <math.h>
double area(int a, int b, int c);
int main(int argc, char *argv[]){
int a, b, c;
printf("\nSide A: ");
scanf("%d", &a);
printf("\nSide B: ");
scanf("%d", &b);
printf("\nSide C: ");
scanf("%d", &c);
printf("\nThe area of the triangle is: %f\n", area(a, b, c));
return(0);
}
double area( int a, int b, int c ){
int s;
double y;
s = (a + b + c)/2;
y = sqrt( s * (s - a)*(s - b)*(s - c) );
return( y );
}