Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
C# Program to generate random lowercase letter
Firstly, set Random class −
Random random = new Random();
Set a range under the Next() method. This displays a letter between 0 and 26.
int a = random.Next(0, 26);
Here is the complete code −
Example
using System;
using System.IO;
using System.Linq;
class Demo {
static void Main() {
Random random = new Random();
// random lowercase letter
int a = random.Next(0, 26);
char ch = (char)('a' + a);
Console.WriteLine(ch);
}
}
Output
t
Advertisements
