Karanbir S.

asked • 04/12/21

What am I doing wrong in my code?

using System;

public class Program

{

public static void Main()

{

Console.WriteLine("How many people are in your class? ")

classSize = int.Parse(Console.ReadLine());

string students = new string[classSize];

for(int i = 0, i<classSize, i++)

{Console.WriteLine("Please enter person "+ (i+1));

students[i] = Console.ReadLine;

Console.Clear();

}

array.Sort(students);

Console.WriteLine(The people in your class in alphabetical order are: );

foreach(string name in students)

{

Console.Write(name " ");

}

}


1 Expert Answer

By:

Patrick B. answered • 04/12/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.