Friday, 1 December 2017

C sharp program Generate Random Numbers


Code:

using System;
class Program
{
    static void Main()
    {
        Console.WriteLine("Some Random Numbers that are generated are : ");
        for (int i = 1; i < 10; i++)
        {
            Randfunc();
        }
    }
    static Random r = new Random();
    static void Randfunc()
    {
        int n = r.Next();
        Console.WriteLine(n);
        Console.ReadLine();
    }
}


Output:

Some Random Numbers that are generated are : 
1234567
8754352
9864930
8352048
1920472
2846104
7649207
4928756
9261746



More C# Programs:


















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...