#include <stdio.h>
#include <math.h>
#define MuzzleVelocity  1000 
#define PI (3.141592653589793)
int main (int argc, const char * argv[]) {
    float G, theta, tf, distance; 
	 G = 9.8; /* M/sec^2  */
	 printf("Enter the angle of elevation for the artillery weapon in degrees ->");
	 scanf("%f", &theta);
	 printf("\nAssuming angle of %f degrees", theta);
	 tf = 2* MuzzleVelocity*sin(theta*PI/180)/G; 
	distance = MuzzleVelocity*cos(theta*PI/180)*tf;
	printf ("\n Distance Traveled in metres %f in seconds %f", distance, tf);
	printf("OK, all done!");
    return 0;
}

