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;
}

 

You give me 15 seconds I promise you best tutorials
Please share your happy experience on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *