I'm a beginner at C so I don't understand why my "False Positives" keep printing a large negative number?
Am I doing something wrong? Please help!
float falsePositive (float accuracy, float incidence, int population);
float accuracy, incidence;
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));