write a well documented program that print out a table of temperatures in Fahrenheit, from 32 to 100, in steps of 2 degrees, with the equivalent Celsius.
To convert a temperature from Fahrenheit to Celsius use the equation:
Temp(C)= (Temp(F)-32)*5/9
Include headings on the columns of figures.
Use the following formatting in your printf to produce a tabulated output:
printf("%4.1f \t %4.1f\n",Fahr, Cent);
this format will print each variable in a field width of 4 digits,with one place of decimal. the"\t" inserts a tab to space the columns.
C语言额。。
|