adplus-dvertising
frame-decoration

Question

Select the output for the following set of Code. Which of the following conditions are true ?
static void Main(string[] args)
 {
     Console.WriteLine("Enter a letter:");
     char c = (char)Console.Read();
     if (Char.IsDigit(c) == true)
         Console.WriteLine("A number");
     else if (char.IsLower(c) == true)
         Console.WriteLine("A lower case letter");
     else if (char.IsUpper(c) == true)
         Console.WriteLine("An upper case letter");
     Console.ReadLine();
 }
 1. Enter a letter :
    a
    An upper case letter
 2. Enter a letter :
    A
    An upper case letter
 3. Enter a letter :
    2
    A number
 4. Enter a letter :
    2
    A lower case letter.

a.

a ,b ,c

b.

b ,c ,d

c.

a ,d ,b

d.

b ,c

Posted under C# programming

Answer: (d).b ,c

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Select the output for the following set of Code. Which of the following conditions are true ?