c2.8 p62 PRACTICE!
Evaluate the following expressions:
1. floor(-2.6)
2. ceil(-2.6)
3. pow(2,-3)
4. sqrt(floor(10.7))
5. fabs(-10*2.5)
6. floor(ceil(10.8))
7. log10(100) + log10(0.001)
8. fabs(pow(-2,5))
c2.8 p63 PRACTICE!
In Problems 1 through 3, give assignment statements for computing the indicated
values, assuming that the variables have been declared and given appropriate
values. Also assume that the following declarations have been made:
#define g 9.8
#define PI (4*atan(1)) /* more accurate than 3.141593 */
1. Velocity computation:
2. Length contraction:
3. Distance of the center of gravity from a reference plane in a
hollow cylinder sector:
In Problems 4 through 6, give the equations that correspond to the assignment statement.
4. Electrical oscillation frequency:
frequency = 1/sqrt(2*pi*c/L);
5. Range for a projectile:
range = (v0*v0/g)*sin(2*theta);
6. Speed of a disk at the bottom of an incline:
v = sqrt(2*g*h/(1 + I/(m*pow(r,2))));