C SHARPE

PART-A

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6

PART-B

PROGRAM B1 PROGRAM B2 PROGRAM B3 PROGRAM B4 PROGRAM B5 PROGRAM B6 PROGRAM B7 PROGRAM B8 . . .

PART B-1 . Write a C Program to sort the given list using quick sort technique.

 
 

 
using System;
using System.Windows.Forms;

namespace WindowsControlsDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Demonstrating Windows Controls");
            Console.WriteLine("1. Label");
            Console.WriteLine("2. Button");
            Console.WriteLine("3. TextBox");
            Console.WriteLine("Enter your choice: ");
            int choice = int.Parse(Console.ReadLine());

            Form form = new Form();

            switch (choice)
            {
                case 1:
                    Label label = new Label();
                    label.Text = "This is a Label control";
                    label.Location = new System.Drawing.Point(10, 10);
                    form.Controls.Add(label);
                    break;
                case 2:
                    Button button = new Button();
                    button.Text = "Click me";
                    button.Location = new System.Drawing.Point(10, 10);
                    button.Click += new EventHandler(ButtonClick);
                    form.Controls.Add(button);
                    break;
                case 3:
                    TextBox textBox = new TextBox();
                    textBox.Location = new System.Drawing.Point(10, 10);
                    form.Controls.Add(textBox);
                    break;
                default:
                    Console.WriteLine("Invalid option. Try again.");
                    break;
            }

            Application.Run(form);
        }

        private static void ButtonClick(object sender, EventArgs e)
        {
            MessageBox.Show("Button was clicked");
        }
    }
}