.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Threading.Tasks;
					
public class Program
{
	public static void Main()
	{
		Console.WriteLine("Hello World");
		
		WriteIntAsync().Wait();
	}
	
	public static async Task<int> GetIntAsync()
	{
		return 42;
	}
	
	public static async Task WriteIntAsync()
	{
		var number = GetIntAsync().Result;
		await Task.Delay(500);
		Console.WriteLine(number);
	}
}
;