how can I make a full csharp application that prints hello in 10 different threads?…
- User
how can I make a full csharp application that prints hello in 10 different threads? using .net framework
Assistant
Here is how you can make a C# console application that prints "Hello" in 10 different threads using .NET Framework:
csharpusing System; using System.Threading; namespace MultiThreadedHello { class Program { static void Main(string[] args) { for (int i = 0; i < 10; i++) { Thread t = new Thread(SayHello); t.Start(); } Console.ReadLine(); } static void SayHello() { Console.WriteLine("Hello"); } } }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.