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
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

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