Problem 3 20 Points For a cone the volume and the surface ar
Problem 3 (20 Points) For a cone, the volume and the surface area can be found by rr2h. where r and h are radius and height, respectively. Write a user-defined function that takes two user inputs (r and h and returns two outputs (V and A). Run a case with r 2, h 3. Run two more cases using input values of your choice. Submission: 1 function m-file, printout of your command window.
Solution
function [vol,area]=cones(d,h)
% To calculate the volume (V)
% To calculate the surface area (A) of cylinder
%diameter is d and height h
r=d/2;
V=(1/3)*pi*r^2*h;
A=pi*r^2+*pi*r*sqrt(r^2+h^2);
%d=4 and h=5
[V,A]=cones(4,5)
