Results 1 to 3 of 3
  1. #1
    victorex27 is offline Member
    Join Date
    Nov 2012
    Posts
    1
    Rep Power
    0

    Post For loop not giving me the required answer.

    Hi.There is this program i am writing to calculate e^x.If i use a for loop and initialize my Variable(t) to 1,after the For loop is executed in Instruction(t*=Fact(z)) it returns 1 at the end of the loop for t(Fact is my method for factorial).Why does this happen and how can i Change this .Thanks.

  2. #2
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,945
    Rep Power
    19

    Default Re: For loop not giving me the required answer.

    You might need to show your code.
    And please wrap it in [code] tags [/code] otherwise it will lose all formatting and fewer people will bother trying to read it.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,435
    Blog Entries
    7
    Rep Power
    20

    Default Re: For loop not giving me the required answer.

    I feel another psychic mood coming up and I see through the mists of the cosmos integer divisions ...

    kind regards,

    Jos ;-)
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. This loop array stuff is giving me a headache
    By EscSequenceAlpha in forum New To Java
    Replies: 1
    Last Post: 05-08-2012, 09:45 PM
  2. while loop tries 20 times before giving up
    By JMAsterson in forum New To Java
    Replies: 3
    Last Post: 04-10-2012, 10:02 PM
  3. [SOLVED] controversy about the required answer
    By vysh in forum Advanced Java
    Replies: 5
    Last Post: 04-28-2009, 08:02 AM
  4. How to loop a question when answer is negatve?
    By brazuca in forum New To Java
    Replies: 6
    Last Post: 04-23-2009, 05:46 AM
  5. Repeat while answer yes - do while loop
    By AJ2009 in forum New To Java
    Replies: 1
    Last Post: 01-10-2009, 06:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •