How to convert Celsius to Fahrenheit and kelvin in C

1 Answer

0 votes
#include <stdio.h>
 
int main(void) {
    int celsius = 24;
     
    float fahrenheit = ((9.0 / 5.0) * celsius) + 32;
    
    float kelvin = celsius + 273.15;
    
    printf("Fahrenheit = %f\n", fahrenheit);
    printf("Kelvin = %f\n", kelvin);
}

 
 
/*
run:
   
Fahrenheit = 75.199997
Kelvin = 297.149994
  
*/

 



answered Dec 14, 2024 by avibootz

Related questions

1 answer 109 views
1 answer 114 views
1 answer 93 views
1 answer 111 views
1 answer 121 views
1 answer 111 views
1 answer 101 views
...