We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ece079d commit 905e996Copy full SHA for 905e996
c_programming/temp_conversion
@@ -1,17 +1,18 @@
1
#include <stdio.h>
2
3
int main(){
4
-int fahr, celsius;
+int celsius,kelvin;
5
int lower, upper, step;
6
7
-lower = -100;
8
-upper = 300;
+lower = 0;
+upper = 100;
9
step = 5;
10
11
-fahr = lower;
12
-while(fahr <= upper){
13
-celsius = 5*(fahr-32)/9;
14
-printf("%d\t%d\n", fahr, celsius);
15
-fahr = fahr+step;
+celsius = lower;
+while(celsius <= upper){
+kelvin = celsius+273;
+printf("%d\t%d\n", celsius, kelvin);
+celsius = celsius+step;
16
}
17
18
+
0 commit comments