How to reverse a string through programming( In C, C#, JAVA)
If you want to reverse a string , just take a string variable and a character array and the length of the array must be same as the length of string , You can achieve this by finding the length of string. And then store the string into character array.
Now to display the string in reverse manner, Just print the array from last index to first index!!!
The example is shown here, it is in C#, you can change it into any of language by just changing the syntax.
Now to display the string in reverse manner, Just print the array from last index to first index!!!
The example is shown here, it is in C#, you can change it into any of language by just changing the syntax.
using System;using System.Collections.Generic;using System.Linq;using System.Text;
namespace ConsoleApplication{ class Program { static void Main(string[] args) { string _myString; Console.WriteLine("Enter any string "); _myString = Console.ReadLine(); int _length = _myString.Length; char[] _reverse = new char[_length]; for (int i = 0; i < _length; i++) { _reverse[i] = _myString[i]; } for (int i = _length-1; i >= 0; i--) { Console.Write(_reverse[i]); } Console.ReadLine(); } }}
Just desire to say your write-up is impressive.
ReplyDeleteThe clearness within your publish is simply impressive and
i can get for granted you happen to be an expert on this field.
Well together with your permission let me to grab
your rss feed to help keep as much as date with future posts.
Many thanks a million and remember to maintain up the solid
function.
Also visit my blog post: 2gts dvds
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteEclipse is hands down my biggest time saver. I don't know how I coded before auto-complete and continuous compilation. There are some drudgery tasks in coding that IDEs like Eclipse can make short work of. Example: You are writing a class which implements an interface. You can use the New Class wizard to specify the class name and the interface class. Eclipse generates the class code with method stubs for the interface implementation. There are other features like generating constructors, generating getters and setters, and generating delegate methods. Set aside some development time to explore the IDE a little and become familiar with its features.
ReplyDeletejava training in chennai
Interesting post! This is really helpful for me. I like it! Thanks for sharing!
ReplyDeleteMobile application developers in Chennai | PHP developers Chennai
MMORPG
ReplyDeleteinstagram takipçi satın al
tiktok jeton hilesi
TİKTOK JETON HİLESİ
antalya sac ekim
referans kimliği nedir
instagram takipçi satın al
Metin2 pvp serverlar
instagram takipçi satın al