Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,888 questions

51,815 answers

573 users

How to convert fahrenheit to celsius in C

3 Answers

0 votes
#include <stdio.h> 

float FahrenheitToCelsius(float f);

int main(int argc, char **argv) 
{
    float temp_f, temp_c;

    printf("Enter Temperature in Fahrenheit: ");
    scanf("%f", &temp_f);
    temp_c = FahrenheitToCelsius(temp_f);
    printf("%.2f Fahrenheit = %.2f celsius\n",temp_f, temp_c);

    return(0);
}
float FahrenheitToCelsius(float f)
{
    float t;
    
    t = (f - 32) / 1.8;
    
    return(t);
}


/*
run1:

Enter Temperature in Fahrenheit: 1
1.00 Fahrenheit = -17.22 celsius

run2:

Enter Temperature in Fahrenheit: 50
50.00 Fahrenheit = 10.00 celsius

*/


answered Apr 30, 2015 by avibootz
0 votes
#include <stdio.h> 

float FahrenheitToCelsius(float f);

int main(int argc, char **argv) 
{
    float temp_f,temp_c;

    printf("Enter Temperature in Fahrenheit: ");
    scanf("%f", &temp_f);
    temp_c = FahrenheitToCelsius(temp_f);
    printf("%.2f Fahrenheit = %.2f celsius\n",temp_f, temp_c);

    return(0);
}
float FahrenheitToCelsius(float f)
{
    float t;
    
    t = (f - 32) * (5.0/9.0);
    
    return(t);
}


/*
run1:

Enter Temperature in Fahrenheit: 1
1.00 Fahrenheit = -17.22 celsius

run2:

Enter Temperature in Fahrenheit: 50
50.00 Fahrenheit = 10.00 celsius

*/


answered May 1, 2015 by avibootz
0 votes
#include <stdio.h>
  
int main(void) {
    int fahrenheit = 96;
      
    double celsius = (fahrenheit - 32) * 5 / 9.0;
      
    printf("Celsius = %f", celsius);
}
  
  
  
  
/*
run:
    
Celsius = 35.555556
   
*/

 



answered Jul 22, 2022 by avibootz

Related questions

1 answer 91 views
1 answer 83 views
1 answer 190 views
190 views asked Jul 15, 2021 by avibootz
1 answer 87 views
1 answer 84 views
1 answer 158 views
158 views asked Jul 15, 2021 by avibootz
1 answer 201 views
...