Skip to main content

Practical-02

Problem Statement

Write a program using different namespaces.

Solution

To solve this problem, we can use C# and demonstrate the usage of different namespaces.

  1. Create a new C# Console Application project in Visual Studio.
  2. In the Solution Explorer, right-click on the project name and select "Add" > "Class".
  3. Name the class "NamespaceDemo.cs".
  4. Open the "NamespaceDemo.cs" file.
  5. Add the following code to demonstrate the usage of different namespaces:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NamespaceDemo
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
}