forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbool_4.cs
More file actions
33 lines (31 loc) · 874 Bytes
/
Copy pathbool_4.cs
File metadata and controls
33 lines (31 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class BoolKeyTest
{
static void Main()
{
Console.Write("Enter a character: ");
char c = (char)Console.Read();
if (Char.IsLetter(c))
{
if (Char.IsLower(c))
{
Console.WriteLine("The character is lowercase.");
}
else
{
Console.WriteLine("The character is uppercase.");
}
}
else
{
Console.WriteLine("Not an alphabetic character.");
}
}
}
/* Sample Output:
Enter a character: X
The character is uppercase.
Enter a character: x
The character is lowercase.
Enter a character: 2
The character is not an alphabetic character.
*/