LPU,NH-1 GT road, Jalandhar rohit.hero12@gmail.com +91-8437503569 https://www.facebook.com/rohit.adhikary3

P-Programming T-Technology A-And TI-Tips C-Cracking

Monday, 20 April 2015

Fahrenheit and Celsius table

Hello reader,
This program is of making the table of Fahrenheit and Celsius and when user will give any value in it it will be showing the result.

#include <stdio.h> //standard library function
  int main()
    int fahr, cel, lower, upper, step;  //define variable
    lower = 0,upper = 300;
    step = 20;     //table upto 20
    fahr = lower;
    while (fahr <= upper) //condition checking {   
     cel = 5 * (fahr - 32) / 9;    //formula for Celsius
     printf("%d\t%d\n",fahr, cel);   //display the result
     fahr += step;
    return 1;  //return the value 



Post a Comment

Popular Posts

Recent Posts

Unordered List

Text Widget

Powered by Blogger.