11. Program that inputs temperature from the user in Farenheit and converts it into Celsius degree.

Chapter 4: 

Input And Output

Programming Exercise

Problem # 11:

Write a program that inputs temperature from the user in Farenheit and converts it into Celsius degree using formula C = 5/9(F-32).

Solution:

#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
    float F, C;
    cout<<"Enter temperature in Farenheit : ";
    cin>>F;
    C = (5.0/9.0) * (F - 32);
    cout<<"Temperature in Celsius : "<<C<<endl;
    return 0;
}

Code Screenshot:

Chapter 4, Coding tutorial, Computer Science, CPP Basics, Exercise Solution, Input and Output, IT Series, Object Oriented Programming using C++, Programming for beginners, Programming Tutorial

Output:

Chapter 4, Coding tutorial, Computer Science, CPP Basics, Exercise Solution, Input and Output, IT Series, Object Oriented Programming using C++, Programming for beginners, Programming Tutorial

Let me know in the comment section if you have any question.

Previous Post:
10. Program that inputs total number of student in a class and fee per student. It displays total fee collected from the class.

Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete

Post a Comment