C++ Project – Temperature Converter
Master C++ with Real-time Projects and Kickstart Your Career Start Now!!
Program 1
// Project for temprature convertor
// Celsius to Fahrenheit and Fahrenheit to Celsius
#include<iostream>
#include<conio.h>
#include<iostream>
#define clrscr() system("cls")
using namespace std;
int main()
{
clrscr();
double tempconv,temp;
int choice;
do
{
cout<<"\n ---------Temprature Convertor-------------";
cout<<"\n 1.Celsius to Fahrenheit ";
cout<<"\n 2.Fahrenheit to Celsius";
cout<<"\n 3.Exit";
cout<<"\n---------------------------------------------";
cout<<"\n Enter your choice: ";
cin>>choice;
if(choice==1)
{
cout<<"\n Enter temprature in celsius: ";
cin>>temp;
tempconv=(temp*9/5)+32;
cout<<"\n Celsius temprature is : "<<temp;
cout<<"\n Fahrenheit temprature is : "<<tempconv;
}
else if (choice==2)
{
cout<<"\n Enter temprature in fahrenheit: ";
cin>>temp;
tempconv=(temp-32)*5/9;
cout<<"\n Fahrenheit temprature is : "<<temp;
cout<<"\n Celsius temprature is : "<<tempconv;
}
}while(choice!=3);
return 0;
}
If you are Happy with DataFlair, do not forget to make us happy with your positive feedback on Google

