C++ Programming

C++ Program & Algorithm Convert Celsius to Fahrenheit

Convert Celsius to Fahrenheit

Write a program that will ask for temperature in Celsius and display it in Fahrenheit.

Algorithm

  • Step 1: Start
  • Step 2: Read temperature in Celsius, c
  • Step 3: f=(9*c)/5+32
  • Step 4: Display temperature in Fahrenheit, f
  • Step 5: End

Source Code

#include<iostream>

#include<conio.h>

using namespace std;

int main ()

{

    float x, cel,fah;

    cout<<"Input temperature in celsius:"<endl;

    cin>>cel;

    fah=(9*cel)/5+32;

    cout<<endl<<"the temperature in fahrenheit is "<<fah <<endl;

    getch();

}

Output

Convert Celsius to Fahrenheit

Tuts

About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.

You may also like

program to find leap year
C++ Programming

C++ Program to Find Leap Year by Using Function

  • March 3, 2016
Write a program to find if the inputted year is a leap year or not by using the concept of