static string[, ] questionsWith3Choices = {
{"What STI stands for?", "System Technology Institute", "Systems Technology Institution", "System Technology Institutes", "A"},
{"Sinong pumatay kay Lapu-lapu?", "Magellan", "Superman", "Hindi ako", "B"},
{"What do people from the Philippines call themselves?", "Filipino", "Pilipino", "Sana all", "C"}};
public static void Display3Questions()
for (int rowIndex = 0; rowIndex < 3; ++rowIndex)
int idxColumn = rowIndex;
string question = questionsWith3Choices[idxColumn, 0];
Console.WriteLine("{0}. {1}", (rowIndex + 1), question);
for (int colIndex = 1; colIndex < 4; ++colIndex)
string choice = questionsWith3Choices[rowIndex, colIndex];
Console.WriteLine(" {0}. {1}", (char)('A' + colIndex - 1), choice);
public static void GetQuestion(int n)
string question = questionsWith3Choices[rowIndex, 0];
Console.WriteLine("{0}. {1}", n, question);
for (int colIndex = 1; colIndex < 4; ++colIndex)
string choice = questionsWith3Choices[rowIndex, colIndex];
Console.WriteLine(" {0}. {1}", (char)('A' + colIndex - 1), choice);
public static bool IsAnswerCorrect(int n)
Console.WriteLine("Error: IndexOutOfBound");
Console.Write("Choose the correct answer (type letter only then, press Enter key): ");
string answer = Console.ReadLine().ToUpper();
string correctAnswer = questionsWith3Choices[rowIndex, 4];
return answer.Equals(correctAnswer, StringComparison.CurrentCultureIgnoreCase);
public static void Main(string[] args)
Console.WriteLine("--- Pick-up random question among 3 questions provided. ---\n");
int randomQuestion = 1 + new Random().Next(3);
GetQuestion(randomQuestion);
if (IsAnswerCorrect(randomQuestion))
Console.WriteLine("Your answer is Correct!");
Console.WriteLine("Your answer is Incorrect!");