Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
VB.NET is Microsoft's modernization of Visual Basic: the beginner-friendly, English-like syntax of classic VB rebuilt on the Common Language Runtime with full object orientation, generics, LINQ, and access to the entire .NET class library. It remains widely used in enterprise line-of-business applications, Office automation shops, and introductory programming courses across US and UK schools, where Dim, Sub, and For...Next read almost like plain sentences. This variant of the page runs your code on the Mono-based VB compiler, which is well suited to console exercises. The terminal is interactive, so Console.ReadLine genuinely pauses your running program and picks up whatever you type, no Visual Studio installation required.
Module Program
Function Factorial(ByVal n As Integer) As Long
If n <= 1 Then Return 1
Return n * Factorial(n - 1)
End Function
Sub Main()
Console.Write("Enter your name: ")
Dim name As String = Console.ReadLine()
Console.WriteLine("Hello, " & name & "!")
Console.Write("Enter a number: ")
Dim n As Integer = Integer.Parse(Console.ReadLine())
Console.WriteLine(n & "! = " & Factorial(n))
For i As Integer = 1 To 3
Console.WriteLine("Loop pass " & i)
Next
End Sub
End Module
VB.NET remains a staple of introductory programming units in UK GCSE/A-level and US community college curricula, where readable keywords lower the barrier for first algorithms: loops, string handling, and simple console menus. In industry it powers long-lived internal business applications, reporting tools, and Office-adjacent automation that teams still extend today. Developers maintaining that legacy code use this page to isolate a function and test it quickly, and students converting between VB.NET and C# check semantics side by side without spinning up an IDE.
Yes. Your compiled program runs attached to a real terminal, so Console.ReadLine blocks until you type a line and press Enter, and Console.Write prompts appear immediately beforehand. Multi-question programs, input validation loops, and simple text menus behave exactly as they would in a local command window.
This page uses the Mono project's VB.NET compiler and runtime, which implements the language and the core class libraries used in console programs: Console, String, Math, collections, and file-free utility types. If you specifically want the modern .NET runtime with the Roslyn-era toolchain, use the separate VB.NET (.NET runtime) page.
No. The sandbox compiles a single console source file, so graphical frameworks like Windows Forms and WPF, project files, and NuGet dependencies are out of scope. Everything in the core library that console programs rely on is available, which covers classwork, algorithm practice, and testing business logic extracted from larger applications.
main.basvbINPUTImports System
Module Program
Sub Main()
Console.WriteLine("Hello from VB.NET!")
End Sub
End Module