Skip to content

Instantly share code, notes, and snippets.

@wbzyl
Created October 23, 2011 12:18
Show Gist options
  • Save wbzyl/1307300 to your computer and use it in GitHub Desktop.
Save wbzyl/1307300 to your computer and use it in GitHub Desktop.
/* wypisz zestawienie temperatur Fahrenheita-Celsjusza
dla f = 0,20,...300 */
#include <stdio.h>
int main() {
int 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*(fahr-32)/9;
printf("%d\t%d\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