S

Shivam • 8.86K Points
Tutor III

Q. What will be the output of the following C# string? (Enter a String : BOMBAY).

Code:
static void Main(string[] args)
{
    string Str,  Revstr = " "; 
    int Length;
    Console.Write("Enter A String : ");
    Str = Console.ReadLine();
    Length = Str.Length - 1;
    while (Length >= 0)
    {
        Revstr = Revstr + Str[Length];
        Length --;
    }
    Console.WriteLine("Reverse  String  Is  {0}",  Revstr);
    Console.ReadLine();
}
  • (A) BOMBA
  • (B) YABMOB
  • (C) BOMAYB
  • (D) YABMO
  • Correct Answer - Option(B)
  • Views: 119
  • Filed under category C#

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics