# Thread: Help: why does it keep showing a wrong number?

1. ## Help: why does it keep showing a wrong number?

I'm a beginner at C so I don't understand why my "False Positives" keep printing a large negative number?

Code:
```#include "stdio.h"

float falsePositive (float accuracy, float incidence, int population);

void question();

int main()
{
printf("QUESTION 1\n");
question();

return 0;
}

void question()
{
float accuracy, incidence;
int population;

printf ("Enter population size:");
scanf ("%d", &population);

printf ("Enter the accuracy of the test as a percentages (e.g. 99):");
scanf ("%f", &accuracy);

printf ("Enter the incidence of the disease as a decimal fraction (e.g. .0001):");
scanf ("%f", &incidence);

printf("Population = %d, accuracy = %.2f, incidence = %.5f, False Positives = %.0f\n", population, accuracy, incidence, falsePositive(accuracy, incidence, population));
}

float falsePositive (float accuracy, float incidence, int population)
{
float falsepositives, healthypeople;
healthypeople = (population * (1-incidence));
falsepositives = (healthypeople * (1-accuracy));

return falsepositives;
}```

2. this may b due to %.0f for falsepositive !!!
try using %.1f

3. Are you sure you're inputting the right percentage?
Code:
```\$ ./a.out
QUESTION 1
Enter population size:1000000
Enter the accuracy of the test as a percentages (e.g. 99):.95
Enter the incidence of the disease as a decimal fraction (e.g. .0001):.0001
Population = 1000000, accuracy = 0.95, incidence = 0.00010, False Positives = 49995
\$ ./a.out
QUESTION 1
Enter population size:1000000
Enter the accuracy of the test as a percentages (e.g. 99):95
Enter the incidence of the disease as a decimal fraction (e.g. .0001):0.0001
Population = 1000000, accuracy = 95.00, incidence = 0.00010, False Positives = -93990600```
In other words, do you need to pre-divide your percentage by 100 to express it as a fraction between 0 and 1 ?

4. Ahh! Finally it works!! Thanks so much for your help, Salem!!