Skip to content

Commit 905e996

Browse files
Budcoderrt2013anurag
authored andcommitted
Update temp_conversion (hacktoberfest17#1675)
1 parent ece079d commit 905e996

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

c_programming/temp_conversion

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
#include <stdio.h>
22

33
int main(){
4-
int fahr, celsius;
4+
int celsius,kelvin;
55
int lower, upper, step;
66

7-
lower = -100;
8-
upper = 300;
7+
lower = 0;
8+
upper = 100;
99
step = 5;
1010

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;
11+
celsius = lower;
12+
while(celsius <= upper){
13+
kelvin = celsius+273;
14+
printf("%d\t%d\n", celsius, kelvin);
15+
celsius = celsius+step;
1616
}
1717
}
18+

0 commit comments

Comments
 (0)