Skip to content

Instantly share code, notes, and snippets.

@wbzyl
Created October 23, 2011 12:29
Show Gist options
  • Save wbzyl/1307309 to your computer and use it in GitHub Desktop.
Save wbzyl/1307309 to your computer and use it in GitHub Desktop.
/* wypisz zestawienie temperatur Fahrenheita-Celsjusza
dla f = 0,20,...300; wersja zmiennopozycyjna */
#include <stdio.h>
int main() {
float fahr, celsius;
int lower, upper, step;
lower=0; /* dolna granica temperatur */
upper=300; /* górna granica */
step=20; /* rozmiar kroku */
fahr=lower;
while (fahr<=upper) {
celsius=(5.0/9.0)*(fahr-32);
printf("%3.0f%6.1f\n",fahr,celsius);
fahr=fahr+step;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment