using System;
namespace Example75
{
///
/// Summary description for Class1.
///
class Class1
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
double[] prices = { 12.23, 3.68, 34.99, 8.87, 63.99 };
Console.WriteLine("The sum is {0:C}", Sum(prices, 0, prices.Length));
}
public static double Sum(double[] p, int start, int end)
{
if (start < end)
{
return p[start] + Sum(p, start + 1, end);
}
else
return 0.0;
}
}
}