Tuesday, January 4, 2011

Program to convert Farenheit to Celsius


/*Name: Program to convert Farenheit to Celsius

Author: Parveen Malik

Date: 05/01/11 10:37

*/


#include<stdio.h>

#include<conio.h>


void main()

{

int lower,upper,steps;

int farn;

float celcius;


lower=0;

upper=100; //you can chanage these parameters like lower,upper and steps

steps=5;


farn=lower;

printf("Fareneit\tCelcius\n");                 //   \t is used to give tab

while(farn<=upper)

{

celcius=5.0/9.0*(farn-32.0);                   // formula to convert Farenheit to Celcius

printf("%d\t\t%.2f\n",farn,celcius);

farn+=steps;

}

getch();

}




 




[caption id="attachment_161" align="aligncenter" width="655" caption="OUTPUT"]Program to convert Farenheit to Celsius[/caption]

 

 

2 comments:

  1. i was looking for the same blog.
    i have noted it down.
    and nice tut with comments and output pic.

    ReplyDelete
  2. Can you post some examples on array and pointers.

    ReplyDelete