Sum of previous twos
//0,1,1,2,3,5,8
//output
//====================
List<int> lstNum = new List<int>();
int n = 7;
for (int i = 0, j = 0; i < n; i++, j++)
{
if (i < 2)
{
lstNum.Add(i);
}
else
{
int x = lstNum[i - 2];
int y = lstNum[i - 1];
lstNum.Add(x + y);
}
}
foreach (int j in lstNum)
{
Console.Write(j.ToString() + ",");
}
Console.ReadLine();
//================================