This Windows Forms application generates Fibonacci numbers asynchronously using threads.
This program allows users to input a positive integer and generates Fibonacci numbers up to the specified count in a ListBox control. The generation of Fibonacci numbers is performed asynchronously using Task-based asynchronous programming (TAP) and multithreading.
- Asynchronously generates Fibonacci numbers.
- Validates user input to ensure it is a positive integer.
- Clears previous output before generating new Fibonacci numbers.
- btnGenerate: Button control to initiate the generation of Fibonacci numbers.
- txtNumber: TextBox control for the user to input the count of Fibonacci numbers to generate.
- listBoxOutput: ListBox control to display the generated Fibonacci numbers.
- Enter a positive integer in the TextBox.
- Click the "Generate" button.
- The generated Fibonacci numbers will be displayed in the ListBox.
- btnGenerate_Click: Event handler for the button click to start the Fibonacci number generation process. It validates user input and triggers the asynchronous generation of Fibonacci numbers.
- GenerateFibonacciNumbersAsync: Asynchronously generates Fibonacci numbers up to the specified count. It uses Task-based asynchronous programming (TAP) and locks the access to the ListBox control to ensure thread safety.
- GenerateFibonacciNumber: Recursive function to generate the nth Fibonacci number.
- C#
- .NET Framework
- Windows Forms
- .NET Framework installed on the system.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Ramees Karolil Rasheed