using System; class HelloWorld { static void Main() { Console.WriteLine("Hello World!"); } }
using System; class Calculator { static void Main() { Console.Write("Enter the first number: "); double num1 = Convert.ToDouble(Console.ReadLine()); Console.Write("Enter the second number: "); double num2 = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Addition: " + (num1 + num2)); Console.WriteLine("Subtraction: " + (num1 - num2)); Console.WriteLine("Multiplication: " + (num1 * num2)); Console.WriteLine("Division: " + (num1 / num2)); } }This is a basic program that takes two numbers as input from the user and performs basic arithmetic operations on them. The `Convert` class is used to convert the user input from a string to a double data type, which can be used for mathematical operations. `Console.Write` and `Console.WriteLine` are used to print text to the console. Library: `System`. In both examples, the `System` namespace is used to provide access to classes and functionality in the .NET framework.