How to add percentage to a number in VB.NET

1 Answer

0 votes
Module Module1

    Sub Main()

        Dim n As Double = 100, percentage As Double = 16

        ' example 1
        Console.WriteLine(n + (n * percentage) / 100)

        ' example 2
        Console.WriteLine(n + n * (percentage / 100))

    End Sub

End Module

' run:
' 
' 116
' 116

 



answered Aug 18, 2018 by avibootz

Related questions

...