Notice that I used a few new tricks here. VB 6 doesn't allow multiple variables to be declared As Type on the same line but VB.NET does. (With VB 6, X and Y would be Variant variables and only Z would be an Integer.) I also put two statements on the same line right after that. This doesn't change the way the program runs but it does save a little space in the program source listing. And I also used the built-in constants vbCrLf and vbTab to format the output a little bit.
Here's what the Debug Output window will display after you run the program (lines shortened to fit the web page):
~~~~~~~~~~~~~~~~~~~~~~~~~
caught exception
System.OverflowException: Arithmetic operation
resulted in an overflow. at
WindowsApplication1.Form1.Button1_Click(Object sender,
EventArgs e) in C:\WindowsApplication1\Form1.vb:line 62
~~~~~~~~~~~~~~~~~~~~~~~~~

