Simple C Programme to convert Farneheit to Celsius


This is my first tutorial on World most Famous language C. C is a old language but still has its own charm is ideal for novice to start programming. In this tutorial We will going  to create a file name temperature.c , I use Linux Mint as OS and GCC Compiler. If you want to know about which IDE I am using then its cross plat form Code::Block so you will get same taste at different environment likewindows, Mac or Linux;

C Programme to convert Farneheit to Celsius

Code

#include <stdio.h>
/*
IDE Used Code::Blocks
A simple script to get
Temperature in Celcius
using formula
c=(f-32)/1.8
*/
int main(){

float farneheit, celsius;
printf("Enter Farneheit = ");
scanf("%f",&farneheit);
celsius=(farneheit-32)/1.8;
printf("Celcius = %.2f", celsius);
//%.2f to make result to two decimal places
return 0;
}

I will not recommend you to copy and paste the code in Code::block better write your own code and compile  and run it.


 Category : C-language   Posted By : Sanjay   on 2015-08-20 16:13:51


Related Post

blog comments powered by Disqus

Login



Categories

May I Know You

  • System » Unknown
  • Browser » Unknown
  • IP Address » 54.225.9.188
  • 13 Online