Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on C# Question within the C# forums, part of the Software Development category; How can i print on screen, a word in reverse example abc to read cba...
|
|||||||
|
|||
|
C# Question
How can i print on screen, a word in reverse example
abc to read cba |
| The Following 4 Users Say Thank You to rokello For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: C# Question
hi rokello
i know that Stack is using "LIFO" : Last In First Out" , So have u try using stacks ? im not sure abt my answer coz i didnt try it its a suggestion.. hope its helpful , im still learning |
|
|||
|
Re: C# Question
class Program
{ static void Main(string[] args) { string str = "string"; char[] chararray = str.ToCharArray(); int length = chararray.GetLength(0); for (int i = 0; i <= length / 2; i++, length--) { char x; x = str[i]; chararray[i] = chararray[length-1]; chararray[length-1] = x; } Console.WriteLine("{0}",new string(chararray).ToUpper()); Console.ReadLine(); } |
|
|||
|
Re: C# Question
//This Code Usefull in Asp.net using C#
protected void Page_Load(object sender, EventArgs e) { string StrName = "Mukesh"; int i; String Show=""; String Show1 = ""; for (i = 0; i < StrName.Length ; i++ ) { Show = StrName[StrName.Length -1 - i].ToString(); Show1 = Show1 + Show; } Response.Write(Show1); } Last edited by mukesh55048; 09-15-2009 at 10:06 AM. |
|
|||
|
Re: C# Question
string word = "seenu";
for (int i = word.Length-1; i >= 0; i--) { Console.Write(word[i]); // or Response.Write(word[i]); } hope this will be usefull for u all...... |
|
|||
|
Re: C# Question
full program
// program for building mirror image of words using System; class Program { public static void Main() { string x; Console.WriteLine("enter the name u want to write in mirror language"); x = Console.ReadLine(); string StrName = x; int i; String Show = ""; String Show1 = ""; for (i = 0; i < StrName.Length; i++) { Show = StrName[StrName.Length - 1 - i].ToString(); Show1 = Show1 + Show; } Console.WriteLine(Show1); } } Last edited by rjroking; 10-18-2009 at 05:05 AM. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| php question | sunilkumar_godd | PHP | 2 | 03-01-2009 02:27 PM |
| One Question | Rohit Ghanekar | Interviews | 1 | 01-28-2009 10:32 AM |
| C++ Question | bee896 | C and C++ | 3 | 10-23-2008 01:59 AM |
| Question about QTP | SangeethaG | QTP | 4 | 09-12-2008 02:27 AM |
| qtp question | manish_swat | QTP | 2 | 09-04-2008 07:41 PM |