re

* Write a C++ Program to design a class Temperature with two float variables fahren and celsius and a member function 'conversion' to convert fahrenheit into celsius */ #include using namespace std; // define a class Temperature class Temperature { private: float fahren, celsius; public: float conversion(float f) { fahren=f; celsius=(fahren-32)* 5.0/9.0; return celsius; } }; int main() { // define an object of Temperature class Temperature t; float f; cout<<"Enter Temperature in Fahrenheit="; cin>>f; // call conversion function with object t cout<<"Temperature in Celsius="<

Comments

Popular posts from this blog

if the marks obtain by a student in five different subjects are input through the keyboard write a program to find out the aggregate marks and percentage marks obtained by the student. assume that the maximum marks that can be obtained by a student in each subject is 100.

If lengths of three sides of a tringle are input through the keyboard write a program to find the area of tringle.

the length and breadth of a rectangle and radius of a circle are input through the keyboard. write a program to calculate the area and perimeter of the rectangle, and the area and circumference of the circle