Print Fahrenheit-Celsius table with for loop - C Data Structure

C examples for Data Structure:Algorithm

Description

Print Fahrenheit-Celsius table with for loop

Demo Code

#include <stdio.h>  

int main()  /*from w w  w.  j a v a2  s .  c  om*/
{  
    int fahr;  

    for (fahr = 0; fahr <= 300; fahr = fahr + 20)  {
        printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32));  
        }
}

Result


Related Tutorials