| 1. |
KDatePageDate 231ogFORMULA BASED PROGRAMS1. Werite a program to find volume of a cylinder.V= Ich CR²_42)where R = radius of the outer surfaceT = gadius of the inner scarfaceheight |
|
Answer» A cylinder can be defined as the solid 3D object having two circular faces connected with the RECTANGULAR surface. The volume of the cylinder is the AMOUNT of space contained by it. The formula to calculate the volume of the cylinder is given below. Formula V=pie x r2 x h where, r is the radius of the cylinder h is the height of the cylinder V is the volume of the cylinder Algorithm Define the height of the cylinder. Define the radius of the cylinder. Calculate the volume of the cylinder pie x r2 x h Define volume_cylinder and assign the volume of the cylinder to it. Solution C PROGRAM #include int main() { int height=38; int radius=35; double pie=3.14285714286; double volume=pie*(radius*radius)*height; printf("Volume of the cylinder=%f",volume); } |
|