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;
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.