Wrox Programmer Forums
|
BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4
This is the forum to discuss the Wrox book Beginning Microsoft Visual C# 2008 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, Eric White; ISBN: 9780470191354
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 24th, 2012, 12:51 PM
Registered User
 
Join Date: Jun 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default application which writes a string in reverse

Hi

I'm learning to program, using this book (Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 ). Chapter 5, exercise 5 requires an application with which a string can be accepted from the user and it can output a string with characters in reverse. I'm using Visual C# 2010 Express, for an IDE.

I've looked up for the solution, which goes like this :

Console.WriteLine("Enter a string:");
string myString = Console.ReadLine();
string reversedString = "";
for (int index = myString.Length - 1; index >= 0; index--)
{
reversedString += myString[index];
}
Console.WriteLine("Reversed: {0}", reversedString);

When I run this, I can't see the end because it just flashes out.
I don't know what is wrong.





Similar Threads
Thread Thread Starter Forum Replies Last Post
reverse not working PerlProgrammer Perl 1 May 10th, 2011 12:28 AM
How to reverse an array here? code_lover C++ Programming 3 February 25th, 2009 09:10 AM
How to get the process that writes a certain filename? aehb C++ Programming 0 January 9th, 2009 05:58 AM
scalar and reverse crmpicco Perl 2 February 16th, 2007 08:18 AM
reverse problem yui0329 C# 5 April 25th, 2005 08:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.