Skip to content
Home » Fahrenheit to Celsius using For loop in C

Fahrenheit to Celsius using For loop in C

Learn about Fahrenheit to Celsius using For loop in C in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.

Fahrenheit to Celsius using For loop in C

Source code:

#include<stdio.h>
int main()
{
  int fahr ;

  for(fahr=0 ; fahr <= 500 ; fahr = fahr + 30)
  {
     printf("%d \t %6.2f \n", fahr, (5.0/9.0) * (fahr - 32) );
  }

  return 0;
}

Output:

0        -17.78 
30        -1.11 
60        15.56 
90        32.22

Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.

Similar Codes :
Fahrenheit to Celsius C Program using While loop
Fahrenheit to Celsius C Program