Reformatted declarations for some floats to more modern standards.
This commit is contained in:
parent
f42b5d0b09
commit
61e32d0e22
2 changed files with 8 additions and 14 deletions
|
|
@ -3,26 +3,20 @@
|
||||||
/* print farenheit-celsius table
|
/* print farenheit-celsius table
|
||||||
* for fahr = 0, 20, ..., 300 */
|
* for fahr = 0, 20, ..., 300 */
|
||||||
|
|
||||||
int main()
|
int main(){
|
||||||
{
|
|
||||||
float fahr;
|
|
||||||
float lower, upper, step;
|
|
||||||
|
|
||||||
lower = 0; /* lower bound of temp scale*/
|
|
||||||
upper = 300; /* upper bound of temp scale*/
|
|
||||||
step = 20; /* step size between calculated conversions*/
|
|
||||||
|
|
||||||
fahr = lower;
|
|
||||||
|
|
||||||
|
float lower = 0; /* lower bound of temp scale*/
|
||||||
|
float upper = 300; /* upper bound of temp scale*/
|
||||||
|
float step = 20; /* step size between calculated conversions*/
|
||||||
|
|
||||||
printf("Temperature conversion table with 20-degree^f steps. \n");
|
printf("Temperature conversion table with 20-degree^f steps. \n");
|
||||||
printf("%4s\t%6s\n", "DegF", "DegC");
|
printf("%4s\t%6s\n", "DegF", "DegC");
|
||||||
|
|
||||||
for (fahr = lower; fahr <=300; fahr = fahr + step)
|
for (float fahr = lower; fahr <=300; fahr = fahr + step){
|
||||||
{
|
fahr = lower;
|
||||||
printf("%4.0f\t%6.1f\n", fahr, (5.0/9.0)*(fahr-32));
|
printf("%4.0f\t%6.1f\n", fahr, (5.0/9.0)*(fahr-32));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
BIN
KNR C/ex1_1.out
BIN
KNR C/ex1_1.out
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue