MATLAB Codes
MATLAB Codes
MATLAB Codes
%program number 1
x=input('Input Height = ');
r=input('Input Radius = ');
y = 1/3*3.1416*x*r;
fprintf('The volume of the cone is %0.02f units cube', y)
%program number 2
q =input('\n\n\nFirst Number = ');
w =input('Second Number = ');
s =
d =
m =
div
q+w;
q-w;
q*w;
= q/w;
fprintf('\nTwo numbers are %d and %d. \nSum is %0.02f \nDifference is %0.02f \nP
roduct is %0.02f \nQuotient is %0.02f', q,w,s,d,m,div)
%program number 3
k = input('\n\n Input X = ');
h = ((log((3)*k))-(exp((2)*k)))/((log10((k)-3))+((k)*(k)));
fprintf(' The answer is %0.02f', h)
%program number 4