# 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. ## 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. Code:
```float x, y;

printf("Enter value of x: ");
scanf("%f", &x);

printf("y = %f\n", 100 / x);```
Does that explain?

3. Originally Posted by chunlee
what's the technical name for this operation?
An inverse ratio?

4. 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