Code:
I am using function to find  the range of a projectile, but whenever I try to run the program it will return zero 0.00. Can someone help me solve this logic problem. thanks in advance.

#include <stdio.h>
#include <math.h>

double distance (double a, double v, double g);
int square(int y);
int main(void)
{
        double v, d, h, datha, degrees, velocity;
        const int pi=3.14159265359;
        const double g= 9.8;

        printf(" enter the angle in degrees");
        scanf("%.2f", &degrees);
        datha = degrees * pi/180;
        printf("Enter the initial veloity\n");
        scanf("%.2f\n", &v);
        velocity = square(v);
        d= distance(datha, velocity,g);
        printf("the reange of the projectile was %.2f", d);
        return 0;
}
int square(int y){
        return pow(y,2);
}
double distance(double a, double v, double g ){
        return v *sin(2*a)/g;
}