Category: C#

How to iterate over a Dictionary in C#?

Below is a sample code snippet demonstrating how to iterate over a dictionary in C#. How to iterate over a Dictionary in C#? using System; using System.Collections.Generic; namespace GinktageApp { internal class Program { private …

How to cast an integer to Enum in C# ?

Below is a sample code snippet demonstrating on casting an integer to enum in C#. How to cast an integer to Enum in C# ? using System; namespace GinktageConsoleApp { public enum Movie { Kaththi …

Difference between String and string in C#

When developing an application using C# , one would have noticed the usage of String and string class . In the below example we use 2 string variable string str1 = "Ginktage.com World"; String str2 …

C# Program to Generate Random Number

Introduction This program developed using C# , .NET Framework and Visual Studio demonstrates how to generate random number in C#. C# Program to Generate Random Number using System; namespace GinktageConsoleApp { internal class Program { …

C# Program to swap two numbers

Introduction This program in C# developed using .NET Framework and Visual Studio  will demonstrate how to swap numbers using the temporary variable. C# Program to swap two numbers using System; using System.Collections.Generic; using System.Linq; using …