You are on page 1of 3

Sol

Logic,Area and Volume formula given


M File or script

disp('This software calculates the volume of a trapezoidal solid prism');

a=input('Enter the value of side a in centimeters=');

b=input('Enter the value of side b in centimeters=');

h=input('Enter the value of height in centimeters=');

l=input('Enter the value of length of prism in centimeters=');

v=(1/2)*((a+b)*h)*l;

fprintf('The volume of trapezoidal solid prism is = %3.2fcm^3\n',v);

Output

This software calculates the volume of a trapezoidal solid prism

Enter the value of side a in centimeters=11

Enter the value of side b in centimeters=5

Enter the value of height in centimeters=4

Enter the value of length of prism in centimeters=15

The volume of trapezoidal solid prism is = 480.00cm^3

You might also like