FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 50   



Following program shows you how to print given string in reverse order.

using System;

class MainClass {
  public static void Main (string[] args) {
    Console.WriteLine("Please enter a string:");
    string input = Console.ReadLine();
    string output = "";
    int length = input.Length;
    for (int i = length; i > 0; i--)
    output = output + input[i - 1];
    Console.WriteLine("Reverse of given string is: " + output);
  }
}

Output:

Please enter a string:
 abcdefg
Reverse of given string is: gfedcba



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News