Question: please use c programming 3. This program computes the gravitational potential energy of an object from its mass and height, but it's poorly programmed. Rewrite

 please use c programming 3. This program computes the gravitational potential

please use c programming

3. This program computes the gravitational potential energy of an object from its mass and height, but it's poorly programmed. Rewrite it to make maximum use of functions and external variables (see text p. 221). See if you can make main so small it contains nothing but function calls and the return statement. #include int main( float m, h, p; float g-9.80665; //m mass in kg; g gravity in m/secA 2; h-height in meters //p Gravitational Potential Energy printf ( InEnter values for mass and height (no commas) "); scant( "%f %f", &m, &h ) ; pem g*h;// printf ( "InThe result for PE(grav) is %f Joules"p); return 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!