Skip to content
Home » C Program to Convert Celsius to Fahrenheit In a Range

C Program to Convert Celsius to Fahrenheit In a Range

Learn about C Program to Convert Celsius to Fahrenheit In a Range in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.

C Program to Convert Celsius to Fahrenheit In a Range

Program:

#include<stdio.h>
int main()
{
   float cel, fahr ;
   int lower, upper, step ;

   lower=100, upper=300, step=50 ;
   cel = lower ;

   while( cel <= upper )
   {
      fahr= ( cel * (9.0/5.0) ) + 32 ;

      printf("%3.0f \t %4.2f \n", cel, fahr ) ;

      cel += step ;
   }

   return 0;
}

Output:

100      212.00 
150      302.00 
200      392.00 
250      482.00 
300      572.00 

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

Similar Codes :
Convert Celsius to Fahrenheit using the C Program
Pattern Program 22 in C