Monday 20 January 2014

How to Create Random Number using C#

Creating Random Number Using C#
Its very easy to create Random number using C#.
In C#,we have simple class call as Random class.
By using this class , we can automatically generate random numeric numbers.
Example :
public static Random r = new Random();
int number = r.Next();

After doing this ,assign this integer variable (number) to your variable.
It will create 9 digit numeric.
Note: You can generate any random number like String,integer etc.