Write a C program which which prints the temperature in celsius from 0 to 20 and their equivalent value in Farnheint | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula gr√°tis
+ 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; }

16th Jul 2020, 5:26 PM
Emalinjachi
Emalinjachi - avatar
1 Resposta
0
guys pls help
16th Jul 2020, 5:27 PM
Emalinjachi
Emalinjachi - avatar