Simple Hello-World Type C++ Console Temp. Conv.
Converts Either Fahrenheit to Calcius or Calcius to Fahrenheit, Good For Beginners. | If You Like It, Vote Highly For It!
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
#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<<"Select an Option:"<<endl;
cout<<" 1 for F to C"<<endl;
cout<<" 2 for C to F"<<endl;
cout<<" 3 To End"<<endl;
cin>>op;
if(op==1) ftocf();
if(op==2) ctoff();
if(op==3) ender();
}
void ctoff()
{
int x;
cout<<"Enter Degrees Celcius to Make Into Fahrenheit:"<<endl;
cin>>x;
cout<<"Result: "<<ctof(x)<<endl<<endl;
main();
}
void ftocf()
{
int y;
cout<<"Enter Degrees Fahrenheit to Make Into Celcius:"<<endl;
cin>>y;
cout<<"Result: "<<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();
}
Original Comments (3)
Recovered from Wayback Machine