square root in c# code example Example 1: c# square root function int num = 4; Math.Sqrt(num); Example 2: c# sqrt using System; Math.Sqrt(Double);