a simple math question

This is a discussion on a simple math question within the C Programming forums, part of the General Programming Boards category; hi there: i got a math operation question i wonder if any can tell me what the technical name for ...

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    23

    a simple math question

    hi there:

    i got a math operation question i wonder if any can tell me what the technical name for it and the best way to code it. i watn to wfite a code to describe the relationship between two variables x, y.

    when x = 1, y = 100
    when x = 2, y = 50
    when x = 4, y = 25
    when x = 0.5, y =200
    when x = 0.25, y = 400

    basically, when x gets larger, y becomes smaller, x gets smaller, y becomes larger.

    what's the technical name for this operation? what's the best way to code this?

    cheers

    CHUN

  2. #2
    </life>
    Join Date
    Oct 2004
    Posts
    83
    Code:
    float x, y;
    
    printf("Enter value of x: ");
    scanf("%f", &x);
    
    printf("y = %f\n", 100 / x);
    Does that explain?
    Microsoft is merely an illusion, albeit a very persistant one.

  3. #3
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,788
    Quote Originally Posted by chunlee
    what's the technical name for this operation?
    An inverse ratio?
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  4. #4
    Registered User
    Join Date
    Nov 2004
    Posts
    23
    yes, thanks! didn't know what happened to my brain, its so simple! i always make things seem more complicated than it is....

    cheers

    CHUN

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple Question!!
    By gameuser in forum C++ Programming
    Replies: 2
    Last Post: 06-06-2009, 05:42 PM
  2. Simple question about pausing program
    By Noid in forum C Programming
    Replies: 14
    Last Post: 04-02-2005, 08:46 AM
  3. simple question.
    By InvariantLoop in forum Windows Programming
    Replies: 4
    Last Post: 01-31-2005, 11:15 AM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  5. simple fgets question
    By theweirdo in forum C Programming
    Replies: 7
    Last Post: 01-27-2002, 05:58 PM

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