well I am not familliar with c programming so it will be so great if anyone could help me
actually I've been asked to write a program which include :
2- In kinetics, we often study projetiles. You are asked to write a program that:
1- prompts the user to enter the magnitude of the initial velocity and the angle it makes with respect to the horizontal axis in DEGREEs.
2- Calculates and displays the range of the projectile, the maximum height it reaches. 3- displays the function of the path y(x).
4- calculates the height at any given point 0<x<range;
We assume that:
-There is no acceleration along the horizontal axis.
-The acceleration along the y axis is the gravity ( g=9.81m/sē)
-The projectile is considered to be a point object and at t=0 x=0 y=0.
and then I've written this and the pb was when I put v0 and theta the range and the hight is 00
Code:
#include <stdio.h>
#include <conio.h>
#include <math.h>
float v0,x,y,os,h;
float theta;
float g = 9.81;
int main()
{
printf("Enter the magnitude of v0:\n");
scanf("%f",&v0);
printf("Enter theta in degree:\n");
scanf("%d",&theta);
os = (v0*v0)*sin(2*(theta))/9.81;
printf("%f\n",os);
h = sqrt(v0*sin(theta))/(2*9.81);
printf("%f\n",h);
printf("y=(tan(theta)*(x))-((0.5*g*x)/(v0*cos(theta)))\n");
getch();
return 0;
}