I can't figure out why the roundf function is not successfully rounding my numbers.
Code:
#include <stdio.h>
#include <math.h>
//function declarations
void CelToFah (int ctemp, int ftemp);
void FahToCel (int cel, int fah);
float roundf (float ftemp);
float roundf (float cel);
I use the roundf function in one of my other functions
Code:
void FahToCel (int fah, int cel)
{
//statements
printf("Please enter the temperature in Fahrenheit degrees.\n");
scanf("%d", &fah);
(cel=(((float)fah-32.0)*5.0/9.0));
roundf((float)cel);
printf("The temperature in degrees Celsius is %d.\n", cel);
return ;
//FahToCel
}
it produces a correct number when called, but it is not a rounded number, the roundf((float)cel) does nothing. I get the same number with and without it.