Can I read Control Structures in C Programming on EtoBox?
Control Structures in C Programming by vincent xu is a document available to read on EtoBox.
What is Control Structures in C Programming about?
Here is the C program to solve the ballistic trajectory problem: #include <stdio.h> #define PI 3.14159 #define g 9.81 int main() { float angle, velocity, distance; printf("Enter firing angle (in degrees): "); scanf("%f", &angle); printf("Enter initial velocity (in m/s): "); scanf("%f", &velocity); angle = angle * PI / 180; if(angle >= 0 && angle <= PI/2) { distance = (velocity*velocity) * sin(2*angle) / g; printf("The horizontal distance = %.3f m\n", distance);
- Author
- vincent xu
- Language
- EN