Get random number in C#

I am explaining here with an example to get randon numbers in See below example which will return two digit number between 10 to 98. You can change numbers (n numbers of digit) according to your requirement.
using System;
private int GetRandomNumbers()
    Random objRan = new Random();
    int randomNumber = 0;
    randomNumber = objRan.Next(10, 99);
    return randomNumber;
//Output: 24

 Posted Comments

No comments have been posted to this article.

 Post a comment

Security Code:
85 + 19
We don't publish your email on our website.