I don't have much experience in programming and i want to know if anyone can show how this can be done.
Implement the following two functions:
/* returns Celsius equivalent of a Fahrenheit temperature (ft) */
double celsius(double ft);
/* returns Fahrenheit equivalent of a Celsius temperature (ct) */
double fahrenheit (double ct);
Use these functions to write a program that prints two tables showing:
(a) the Fahrenheit equivalent of all Celsius temperatures from 0 to 100 degrees with increment 2.
(b) the Celsius equivalent of all Fahrenheit temperatures from 32 to 212 degrees with increment 4.
Code:#include <stdio.h> #include <stdlib.h> int main ( void ) { int i, celsius, farenheit, printf("\t\tFahrenheit<->Celsius Celsius<->Fahrenheit\n\n\n"); for ( i = 0; i <= 100; i += 2 ) { farenheit = ((9.0 / 5.0) * i) + 32; celsius = (5.0 / 9.0) * (i - 32.0); printf ( "\t\t%3d\t - %6.2f \t%3d\t - %6.2f\n",\ i, celsius, i, farenheit ); } return EXIT_SUCCESS;