TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
harish reddy
NA
162
33.5k
Query in Result
May 23 2017 1:14 AM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HelperMethods
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("The Name Game");
Console.Write("What's your first name? ");
string firstName = Console.ReadLine();
Console.Write("What's your last name? ");
string lastName = Console.ReadLine();
Console.Write("In what city were you born?");
string city = Console.ReadLine();
char[] firstNameArray = firstName.ToCharArray();
Array.Reverse(firstNameArray);
char[] lastNameArray = lastName.ToCharArray();
Array.Reverse(lastNameArray);
char[] cityArray = city.ToCharArray();
Array.Reverse(cityArray);
string result = "";
foreach (char item in firstNameArray)
{
result += item;
}
result += " ";
foreach (char item in lastNameArray)
{
result += item;
}
result += " ";
foreach (char item in cityArray)
{
result += item;
}
Console.WriteLine("Results: " + result);
Console.ReadLine();
}
}
}
In the program above, what does string result = ""; & result += item; & result += " "; do ? I dont understand what these do?
Reply
Answers (
2
)
Binary to Decimal Conversion
How to create custom controls in visual studio 2015