Please visit our sponsor
UNKNOWN //************************************** //INCLUDE files for :Simple Hello-World Type C++ Console Temp. Conv. //************************************** iostream.h, conio.h //************************************** // Name: Simple Hello-World Type C++ Console Temp. Conv. // Description:Converts Either Fahrenheit to Calcius or Calcius to Fahrenheit, Good For Beginners. | If You Like It, Vote Highly For It! // By: Jeff Katz // // // Inputs:None // // Returns:None // //Assumes:Must be a console application // //Side Effects:None //This code is copyrighted and has limited warranties. //Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.259/lngWId.3/qx/vb/scripts/ShowCode.htm //for details. //************************************** #include <iostream.h> #include <conio.h> double ctof(double x); double ftoc(double x); void ftocf(); void ender(); void ctoff(); int op; void main () { op=0; cout&lt;&lt;"Select an Option:"&lt;<endl; cout<<" 1 for f to c"<<endl; cout<<" 2 for c to f"<<endl; cout<<" 3 to end"<<endl; cin>&gt;op; if(op==1) ftocf(); if(op==2) ctoff(); if(op==3) ender(); } void ctoff() { int x; cout&lt;&lt;"Enter Degrees Celcius to Make Into Fahrenheit:"&lt;<endl; cin>&gt;x; cout&lt;&lt;"Result: "&lt;<ctof(x)<<endl<<endl; main(); } void ftocf() { int y; cout<<"enter degrees fahrenheit to make into celcius:"<<endl; cin>&gt;y; cout&lt;&lt;"Result: "&lt;<ftoc(y)<<endl<<endl; main(); } double ctof(double x) { return ((x*1.8)+32); } double ftoc(double y) { return ((y-32) 1.8); } void ender() { cout<<"press any key to exit"<<endl; getch(); } < xmp>