You are on page 1of 2

Write a program that prompts user to enter the temperature and then

through menu asks for conversion in Fahrenheit, Kelvin and Centigrade


============================================
#include<iostream.h>
#include<conio.h>

int CtoF(int);
int CtoK(int);
int FtoC(int);

void main(){
clrscr();

int tempc,tempf,result;

cout<<"\n Enter Centigrade Temperature: ";


cin>>tempc;

result=CtoF(tempc);

cout<<"\n Temperature in Fahrenheit is: "<<result;


result=CtoK(tempc);

cout<<"\n Temperature in Kelvin is: "<<result;


cout<<"\n Enter Temperature in Fahrenheit: ";
cin>>tempf;
result=FtoC(tempf);

cout<<"\n Temperature in Centigrade is: "<<result;

getch();
}

int CtoF(int c){


int res;
res=(9/5)*c+32;
return res;
}

int FtoC(int f){


int res;
res=(5/9)*f-32;
return res;
}
int CtoK(int ce){
return ce+273;
}

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006