+ 2
Write a C program which which prints the temperature in celsius from 0 to 20 and their equivalent value in Farnheint
i just tried to write it but when i compile it it gives the first value 0 a correct equivalent in Farnheint which is 32 but for the lest value it gives worng equivalent in F #include <stdio.h> int main() { float fahrenheit, celsius; int low, high, interval; low = 0; high = 20; interval = 1; printf(" c \t f\n\n"); celsius = low; while(celsius <= high) { fahrenheit = ((9 / 5)*celsius + 32); printf("%3.0f \t %3.1f\n", celsius, fahrenheit); celsius = celsius + interval; } return 0; }
1 Resposta
0
guys pls help