In C#, you can return the answer to life, universe and everything else (which is 42) by writing a simple function with a return statement that returns the integer value 42. Here's an example:
main.cs66 chars5 lines
You can call this function from your main program like this:
main.cs77 chars3 lines
This will output 42
to the console.
gistlibby LogSnag