text: Program to find the Magnitude of a Vector | C # program for the above approach ; Function to calculate magnitude of a 3 dimensional vector ; Stores the sum of squares of coordinates of a vector ; Return the magnitude ; Driver code
code: using System ; class GFG { private static double vectorMagnitude ( int x , int y , int z ) { int sum = x * x + y * y + z * z ; return Math . Sqrt ( sum ) ; } static void Main ( ) { int x = 1 ; int y = 2 ; int z = 3 ; Console . Write ( vectorMagnitude ( x , y , z ) ) ; } }