You will write a program that accumulates names entered by the user.
You will make two accumulations:
using System; class Program/*from ww w . j a v a 2 s .com*/ { static void Main(string[] args) { // Preparation - variables to accumulate intermediate results string r = ""; string inReversedOrder = ""; // Input of the first person Console.Write("Enter first person: "); string person = Console.ReadLine(); // Appending the first person to intermediate result r += person + Environment.NewLine; inReversedOrder = person + Environment.NewLine + inReversedOrder; // Input of the second person Console.Write("Enter second person: "); person = Console.ReadLine(); // Appending the second person to intermediate result r += person + Environment.NewLine; inReversedOrder = person + Environment.NewLine + inReversedOrder; // Input of the third person Console.Write("Enter third person: "); person = Console.ReadLine(); // Appending the third person to intermediate result r += person + Environment.NewLine; inReversedOrder = person + Environment.NewLine + inReversedOrder; Console.WriteLine("Entered persons"); Console.WriteLine(r); Console.WriteLine("In reversed order"); Console.WriteLine(inReversedOrder); } }