Exercise
Function Double reference parameter
Objetive
Write a Visual Basic (VB.Net) function named "Double" to calculate the double of an integer number, and modify the data passed as an argument. It must be a "void" function and you must use "refererence parameters". For example.
x = 5;
Double(ref x);
Console.Write(x);
would display 10
Code
Imports System
Public Class exercise105
Public Shared Sub Double(ByRef n As Integer)
n = n + n
End Sub
Public Shared Sub Main()
Dim x As Integer = 2
Double(x)
Console.WriteLine(x)
End Sub
End Class