I am trying to print each key and value from the QandA_Dictionary shown below, but I keep getting System.int32[] instead of the actual values I have listed. Could someone please point me in the right direction of resolving this issue?
using System;
using System.Collections;
using System.Collections.Generic;
namespace DictionaryPractice
{
class MainClass
{
public static void Main(string[] args)
{
Dictionary<string, int[]> QandA_Dictionary = new Dictionary<string, int[]>();
QandA_Dictionary.Add("What is 1 + 1?", new int[] { 1, 2, 3, 4 });
QandA_Dictionary.Add("What is 1 + 2?", new int[] { 1, 2, 3, 4 });
QandA_Dictionary.Add("What is 1 + 3?", new int[] { 1, 2, 3, 4 });
QandA_Dictionary.Add("What is 1 + 4?", new int[] { 2, 3, 4, 5 });
foreach (var pair in QandA_Dictionary)
{
Console.WriteLine("{0},{1}", pair.Key, pair.Value);
}
Console.ReadKey();
}
}
}