Example: Principal Payments

The payment on the principal the first year on a 25 year, $100,000 loan is calculated. The loan is at 8%.
using System;
using Imsl.Finance;

public class ppmtEx1
{
    public static void  Main(String[] args)
    {
        double rate = .08;
        int per = 1;
        int nper = 25;
        double pv = 100000.00;
        double fv = 0.0;
        
        double ppmt = Finance.Ppmt(rate, per, nper, pv, fv, 
                                   Finance.Period.AtEnd);
        Console.Out.WriteLine("The payment on the principal the first "
                              + "year \nof the $100,000 loan is " +
                              ppmt.ToString("C"));
    }
}

Output

The payment on the principal the first year 
of the $100,000 loan is ($1,367.88)

Link to C# source.