SHARE
TWEET

yup

a guest Dec 16th, 2012 26 Never
  1. String sNumbers = JOptionPane.showInputDialog("Enter in the amount of possible numbers: \n");
  2.                 int iNumbers = Integer.parseInt(sNumbers);
  3.                 String sBalls = JOptionPane.showInputDialog("Enter in the amount of balls taken: \n");
  4.                 int iBalls = Integer.parseInt(sBalls);
  5.                 int iFactorial = 1;
  6.                 int iCount = 0;
  7.                 int iTotal = iNumbers;
  8.  
  9.                 for(iCount = (iNumbers - 1); iCount > (iNumbers - iBalls); iCount--){
  10.                         iTotal *= iCount;
  11.                 }
RAW Paste Data
Top