Exercise
Division of two numbers
Objetive
Write a Visual Basic (VB.Net) program to print the result of dividing 24 by 5 on the screen.
Code
' Main class definition
Public Class Program
' Main subroutine, entry point of the program
Public Shared Sub Main()
' Declare and initialize two integers
Dim dividend As Integer = 24
Dim divisor As Integer = 5
' Calculate the division result as a double to allow decimal places
Dim result As Double = dividend / divisor
' Display the result of the division on the screen
Console.WriteLine("The result of dividing 24 by 5 is: " & result)
End Sub
End Class