Geeks Talk

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.

C# Question

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...

Go Back   Geeks Talk > Software Development > C#
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 01-28-2009
Junior Member
 
Join Date: Jan 2009
Location: Toronto
Posts: 1
Thanks: 0
Thanked 4 Times in 1 Post
rokello is on a distinguished road
C# Question

How can i print on screen, a word in reverse example
abc to read cba
Reply With Quote
The Following 4 Users Say Thank You to rokello For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 01-29-2009
Junior Member
 
Join Date: Jan 2009
Location: Jorfan
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
eng_jumana is on a distinguished road
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
Reply With Quote
  #3 (permalink)  
Old 02-04-2009
Junior Member
 
Join Date: Feb 2009
Location: Bourgas
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
testMadness is on a distinguished road
Re: C# Question

string word = "test";
for (int i = 0; i < = word.Length/2; i++)
{
char c = word[i];
word[i] = word[word.Length - 1 - i];
word[word.Length - 1 - i] = c;
}
Reply With Quote
  #4 (permalink)  
Old 02-08-2009
Junior Member
 
Join Date: Feb 2009
Location: delhi
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
guarvmishra is on a distinguished road
Re: C# Question

simply u can use loop for this & othrer option u can use the concept of substring
Reply With Quote
  #5 (permalink)  
Old 02-17-2009
Junior Member
 
Join Date: May 2008
Location: delhi
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
prakashsatya is on a distinguished road
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();

}
Reply With Quote
  #6 (permalink)  
Old 08-28-2009
Junior Member
 
Join Date: Aug 2009
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Sr.Malkiat Siingh Rana is on a distinguished road
Re: C# Question

C# expressed edition use The MssageBox.Show( ) method to show the message.

Last edited by Sr.Malkiat Siingh Rana; 08-28-2009 at 02:16 AM.
Reply With Quote
  #7 (permalink)  
Old 09-15-2009
Junior Member
 
Join Date: Sep 2009
Location: India
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
mukesh55048 is on a distinguished road
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.
Reply With Quote
  #8 (permalink)  
Old 09-21-2009
Junior Member
 
Join Date: Mar 2008
Location: Kurnool
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
sreenivasuluyc is on a distinguished road
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......
Reply With Quote
  #9 (permalink)  
Old 10-18-2009
Banned
 
Join Date: Oct 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
rjroking is on a distinguished road
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.
Reply With Quote
Reply

  Geeks Talk > Software Development > C#

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


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


All times are GMT -4. The time now is 08:45 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved