This is code for calculate the area of tragle using functions but my code idn't work properly Why is that?

#include<stdio.h>
double tranglearea(double a,double b);
double main()
{ double x,y,p;
printf(“enter value for base x: \n”);
scanf("%.2f",&x);
printf(“enter value for height y:\n”);
scanf("%.2f",&y);
p=tranglearea(x,y);
printf(“Area of the trangular is %.2f”,p);

}
double tranglearea(double a,double b){
double u=0.5ab;
return (u);

}

#include<stdio.h>
float tranglearea(float a,float b);
int main()
{ float x,y,p;
printf(“enter value for base x: \n”);
scanf("%f",&x);
printf(“enter value for height y:\n”);
scanf("%f",&y);
p=tranglearea(x,y);
printf(“Area of the triangle is %.2f”,p);

}
float tranglearea(float a,float b){
float u=0.5ab;
return (u);

}

please try this one