C# Program to Generate Random Number


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
        private static Random randomNumber = new Random();

        private static void Main(string[] args)
            int output = randomNumber.Next();


If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Reply


Interesting BlogPosts to read

How to perform Shallow Copy in C# ? by @abundantcode
To perform Shallow copy in C# , you can use the this.MemberwiseClone() method. How to perform Shall...
How to add entries to ResourceDirectory in WPF using C# ?
Below is a sample code snippet demonstrating how the entries can be added to the ResourceDirectory i...
Replacing Multiple spaces with single space in C#
Are you looking at an sample demonstrating the usage of the regular expression to replace multiple s...