public static void Main(string[] args)
Console.WriteLine("Please enter the maximum number of questions");
int questionsCnt = Convert.ToInt32(Console.ReadLine());
while (mx < 2 || mx > 9) {
Console.WriteLine("Please enter an integer value between 2 and 9 (max number of alphabetic characters to be sorted)");
mx = Convert.ToInt32(Console.ReadLine());
String[] questions = new String[questionsCnt + 1];
String[] answers = new String[questionsCnt + 1];
for (int i = 1; i <= questionsCnt; i++) {
Console.WriteLine("=================================");
Console.WriteLine("Question : " + i);
Console.WriteLine("What is the correct order of following characters:");
Random random = new Random();
char[] str = new char[mx];
for (int j = 0; j < mx; j++) {
str[j] = Convert.ToChar(random.Next(65, 90));
questions[i] = new String(str);
answers[i] = Console.ReadLine();
if (questions[i] == answers[i]) correct++;
Console.WriteLine("\nTo get the number of right answers, type 1");
Console.WriteLine("To get the number of wrong answers, type 2");
Console.WriteLine("To view all the questions with correct and answered responses, type 3");
Console.WriteLine("To exit, type exit");
String ch = Console.ReadLine();
Console.WriteLine("The number of right answers is : " + correct);
Console.WriteLine("The number of wrong answers is : " + (questionsCnt - correct));
Console.WriteLine("Question User Answer Correct");
Console.WriteLine("=======================================");
for (int i = 1; i <= questionsCnt; i++) {
String res = questions[i];
Array.Sort(res.ToCharArray());
Console.WriteLine(questions[i] + " " + answers[i] + " " + res);