5. Falling Distance When an object is falling because of gravity, the following
ID: 3678322 • Letter: 5
Question
5. Falling Distance When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period: 2gt The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time, in seconds, that the object has been falling. Write a function named fallingDistance that accepts an object's falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval. Write a program that demonstrates the function by calling it in a loop that passes the values 1 through 10 as arguments and displays the return value.Explanation / Answer
C Programme:
// Program to find object's distance falls in a specific time period
#include<stdio.h>
float fallingdistance(int);
int main()
{
int time1;
float distance;
printf(" Enter the Object's falling time : ");
scanf("%d",&time1);
distance = fallingdistance(time1);
printf(" Distance travelled by Object is : %f Meters ",distance);
return(0);
}
float fallingdistance(int time2)
{
float distance1;
distance1 = 0.5 * 9.8 * time2* time2;
return(distance1);
}
Output:
Enter the Object's falling time : 5
Distance travelled by Object is : 122.500000 Meters
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.