6
Answers

NP138 Random

Maha

Maha

16y
1.8k
1

Hi Guys

 

NP138 Random

 

In the following program output 1, 2, 3, 4, 5 and 6 is coming, 7 is not coming. Please explain the reason.

 

Thank you

 

using System;

 

class MainClass

{

    public static void Main()

    {

        Random ran = new Random();

 

        Console.WriteLine(ran.Next(1, 7));

    }

}

Answers (6)