Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

CuTee Simple factorial

  1. Apr 15, 2006 #1
    //int input;

    void Factor::init(){
        InputEdit->setValidator(new QDoubleValidator(InputEdit));


    int Factor::factorials(int n){
        if(n<=1) return 1;
        return n*factorials(n-1);

    void Factor::FactorNumber()
        int input=InputEdit->text().toDouble();
    *** 2 edit boxes: InputEdit for input number; FactorialDisplay to display factor "in action"
    *** 1 button called FactorButton implements factorNumber() connecting to the main form named Factor.

    No errors but program run wild when unfactorable number is used and my text edit box does display factoring process till input equals 1

    Help me with this little problme plz.
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted

Similar Discussions: CuTee Simple factorial
  1. Simple Matlab (Replies: 2)

  2. An simple program (Replies: 3)

  3. Fortran Factorials (Replies: 6)