C# Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 268 Page Views: 

How do you use random number generator in c#?



Posted By: Avi Date: 14 October 2010 01:12:47 AM
 Answer:

Random r = new Random(); double t = r.NextDouble();


Posted By: avibtech


Date: 14 October 2010 01:12:47 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image pnyasl
Related Questions
C# : Will this code compile:
class A { private static int Field; }
class B { int Method() { return A.Field;} }

Will this code compile: class A { private static int Field; } class B { int Method() { return A.Fiel....

No. Field is inaccessible due to its protection level
Category: C# Date: 10/14/2010 8:09:31 AM
C# : What will be the output of code:
int x = 0;
while(x++ <5)
{
Console.Write(x);
}

What will be the output of code: int x = 0; while(x++ <5) { Console.Write(x); }

Answer: 12345
Category: C# Date: 10/14/2010 8:06:14 AM
C# : What is the scoope of anonymous type?

What is the scoope of anonymous type?

An anonymous type has method scoope?
Category: C# Date: 10/14/2010 7:43:31 AM
C# : How do you list files in given directory?

How do you list files in given directory?

Use System.IO.Directory.GetFiles(path) method
Category: C# Date: 10/14/2010 7:28:46 AM
C# : What is background worker and how do you use it?

What is background worker and how do you use it?

BackgroundWorker is class that allows to run long operations in background thread. The DoWork event ....
Category: C# Date: 10/14/2010 6:48:14 AM