हिंदी

Implement of a class temperature to convert degree. Fahernheit value to degree celcuis value. (Hint: (c/5 = f − 32/9) Where C is temperature in degree celcuis an F is temperature in Fahernheit degree) - Computer Science 1

Advertisements
Advertisements

प्रश्न

Implement of a class temperature to convert degree.Fahernheit value to degree celcuis value.

(Hint: (c/5 = f − 32/9) Where C is temperature in degree celcuis an F is temperature in Fahernheit degree)

कोड लेखन
Advertisements

उत्तर

//C++ program to convert degree.Fahrenheit value to degree celsius value

#include <iostream.h>
class temperature
{
      float tcel;
      float tfht;
      public:
      void getdata();
      void display();
};
void temperature::getdata(void)
{
      cout <<"Enter the degree Fahrenheit";
      cin >> tfht;
}
      void temperature::display(void)
{
      tcel = 5/9 * (tfht - 32);
      cout << "The degree celsius:";
      cout << tcel;
}
      void main() 
{
      temperature t1;
      t1.getdata();
      t1.display(); 
}
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2024-2025 (March) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×