English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

// funtion prototypes
int getFarenheit ();
double calcCelcius (int);

//call function
faren = getFarenheit ();
celc = calcCelcius (celcius);

//function definition
double calcCelcius (int degree)
{double celcius = 0;
celcius = 5.0/9.0 *(degree - 32);
return celcius;
}

2007-04-07 06:10:56 · 1 answers · asked by Krys F 1 in Computers & Internet Programming & Design

1 answers

you can try this:
change
celcius = 5.0/9.0 *(degree - 32);
to
celcius = 5.0/9.0 *((double)degree - 32.0);
it should cast all ints to doubles

2007-04-08 02:11:06 · answer #1 · answered by justme 7 · 0 0

fedest.com, questions and answers