Like this:
MsgBox("The Factorial of " + myNumber + " is " + FactorialChecker())
You just didn't close your quotes for the first part of the string so they're unbalanced, thus your compiler errors. Also, I added some spaced because I assume you'll want them.
Note that in VB.NET, using MessageBox.Show
is preferable to the old VB6-style MsgBox
function. Also, in VB, the &
operator is typically recommended over the +
operator for string concatenations, since the +
operator can have some unexpected results when you have Option Strict Off
. So, this would be the better way to do that:
MessageBox.Show("The Factorial of " & myNumber & " is " & FactorialChecker())