C++ program to Convert Celsius to Fahrenheit

Question : Write a C++ program to Convert Celsius to Fahrenheit ?

Explain: C++ Question about conversion Celsius to Fahrenheit with input from user then program convert Celsius to Fahrenheit.

Formula:
Fahrenheit = (Celsius * 9/5) + 32

Solution:

 /************************************************************ 
     C++ Program for Convert Celsius to Fahrenheit
 *************************************************************
***************** By www.cpplanguage.com *********************/


#include<iostream>
using namespace std;
int main()
{
 float celsius , fahrenheit;
    cout << "Enter Temperature in Celsius : ";
    //input as Celsius ;
    cin >> celsius;
    //formula conversion celsius to fahrenheit
fahrenheit = (celsius * 9/5) + 32;
cout<<"Temperature in Fahrenheit: "<<fahrenheit;
    return 0;
}

Output:
C++ code for Convert Celsius to Fahrenheit


No comments:

Post a Comment