Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 505 Bytes

File metadata and controls

35 lines (23 loc) · 505 Bytes

Experiment No 4

Aim

Square Root of a Number

Objective

Compute square root using built-in math functions and user input.

Process Flow

  1. Import the math module.
  2. Read a number from the user.
  3. Use math.sqrt() to calculate the square root.
  4. Print the result.

Code

import math

num = float(input("Enter a number: "))
sqrt_val = math.sqrt(num)
print(f"Square root of {num} is {sqrt_val}")

Output

Enter a number: 16
Square root of 16.0 is 4.0