program to find ncr and npr