Lab Assignment 2 Date 17.04.
2026
MATLAB Script File
1. Write a script that asks the user to enter the radius of a circle. Compute and display:
(i) Area of the circle
(ii) Circumference of the circle
2. Write a script that accepts 5 numbers from the user. Compute and display:
(i) Sum of the numbers
(ii) Average of the numbers
3. Given x = 6.3 and y = 4.4, write a script to evaluate:
(i) x^2 + y^2 − x^3/y^3
(ii) sqrt(x*y) − sqrt(x+y) + (x−y)/(x−2*y) − sqrt(x/y)
4. Write a script to compute sin(θ), cos(θ) and tan^2(θ) + cot^2(θ)
for θ = 0° to 360° in steps of 15°. Display the result in tabular form.
5. Write a script that accepts the side of a cube from the user. Compute and display:
(i) Volume
(ii) Surface area
(iii) Space diagonal
6. Write a script that asks the user to enter the length and breadth of a rectangle. Compute and display:
(i) Area
(ii) Perimeter
(iii) Length of diagonal
7. Write a script that asks the user to enter temperature in Celsius. Convert and display the temperature
in:
(i) Fahrenheit
(ii) Kelvin
8. Write a script that accepts three numbers from the user.
Compute and display:
(i) Maximum number
(ii) Minimum number
(iii) Mean value
9. Write a script that asks the user to enter principal amount, rate of interest,
and time. Compute and display:
(i) Simple Interest
(ii) Total Amount
10. Write a script that accepts the radius and height of a cylinder from the user.
Compute and display:
(i) Volume
(ii) Curved surface area
(iii) Total surface area