- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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