A Beginners Guide to Fly x Tin PracticeTest C Secure l h moo
Solution
Solution ::
//////////// To compute the area of a circle from the given input Radiusius //////////////////
function[circum, Area]= circumarea(Radius)
circum=2*pi*Radius;
Area=pi*Radius*Radius;
fprintf(\'Circumference of the circle is %f\ \',circum);
fprintf(\'Area of the circle is %f\ \', Area);
end
///////////////// to find the greater ,lesser,equal area among the circles
Function:
function [area] = CircleArea(Radius)
Area = pi * Radius^2;
Script:
Radius1 = input(\'Enter the Radius of the Circle 1\');
Area1 = CircleArea(Radius1);
disp([\'Area of the Circle1 = \' number2str(Area1)])
Radius2 = input(\'Enter the Radius of the Circle 2\');
Area2 = CircleArea(Radius2);
disp([\'Area of Circle2 = \' number2str(Area2)])
if(Area1 > Area2)
disp(\'Area of the Circle1 is greater than the area of Circle2\');
elseif (Area1 < Area2)
disp(\'Area of the Circle1 is less than thearea of Circle2\');
else
disp(\'Area of the Circle1 is equal to the area of Circle2\');
end
/// *** Thank You *** ///
