exponential

This is a discussion on exponential within the C Programming forums, part of the General Programming Boards category; Prepare a program that reads two integers x and n, and calculate exp using the following formula: exp = 1+ ...

  1. #1
    hei
    hei is offline
    Registered User
    Join Date
    Oct 2001
    Posts
    12

    Question exponential

    Prepare a program that reads two integers x and n,
    and calculate exp using the following formula:

    exp = 1+ x/1 +x2/2! +x3/3! + ...

    x2,x3 means x power 2, x power 3.

    The integer n is used to govern the number of terms that
    will be used for obtaining the approximate value of exp.

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    Yep, that's exponential alright... so what's the problem? We can't just write the program for you...

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,687
    Code:
    int i, x, n;
    printf( "Enter...." );
    scanf( "%d %d", &x, &n );
    for ( i = 0 ; i < n ; i++ ) {
        // your turn
    }
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Exponential Notation
    By Hank Diddler in forum C Programming
    Replies: 2
    Last Post: 09-15-2007, 12:34 AM
  2. exponential numbers
    By Loic in forum C++ Programming
    Replies: 4
    Last Post: 07-31-2007, 07:58 PM
  3. Negative Exponential
    By vasanth in forum Tech Board
    Replies: 2
    Last Post: 09-01-2004, 09:31 AM
  4. converting a string to exponential
    By addisonp in forum C Programming
    Replies: 3
    Last Post: 08-14-2003, 06:05 PM
  5. exponential operator
    By mikebrewsj in forum C++ Programming
    Replies: 2
    Last Post: 01-16-2002, 07:05 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21