Armand commented on a Page, Temperature Converter  -  Nov 28, 2009

Remove all 3 constants, as they're not needed in this short of code. A numeric value that is hard-coded isn't going to change. Now if you just used a double NAME, then it might change. So for the Temperature function:

void Temperatures(double fahrenheit) {
double celsius, kelvin;

celsius = fahrenheit * 1.8 + 32.0;
kelvin = celsius + 273.15;

printf("Fahrenheit: %.2lf\n", fahrenheit);
printf("Celsius: %.2lf\n", celsius);
printf("Kelvin: %.2lf\n", kelvin);

}

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.