Multiple operations and precedences Learn programming Visual Basic (VB.net)

Lesson:

First contact with Visual Basic (VB.net)


Exercise:

Multiple operations and precedences


Objetive:

Create a Visual Basic (VB.net) program to print the result of the following operations:
-1 + 3 * 5
(24 + 5) % 7
15 + (-4) * 6 / 11
2 + 10 / 6 * 1 - 7 % 2


Code:

Imports System

Public Class exercise4
    Public Shared Sub Main()
        System.Console.WriteLine(-1 + 3 * 5)
        System.Console.WriteLine((24 + 5) Mod 7)
        System.Console.WriteLine(15 + -4 * 6 / 11)
        System.Console.WriteLine(2 + 10 / 6 * 1 - 7 Mod 2)
    End Sub
End Class

Juan A. Ripoll - Systems Tutorials and Programming Courses ©  All rights reserved.  Legal Conditions.