Want more features on Pastebin? Sign Up, it's FREE!
Guest

yup

By: a guest on Dec 16th, 2012  |  syntax: Java  |  size: 0.43 KB  |  views: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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.                 }
clone this paste RAW Paste Data