सबसे पहले, फारेनहाइट तापमान सेट करें -
double fahrenheit = 97;
Console.WriteLine("Fahrenheit: " + fahrenheit); अब इसे सेल्सियस में बदलें -
celsius = (fahrenheit - 32) * 5 / 9;
उदाहरण
फ़ारेनहाइट को सेल्सियस में बदलने के लिए आप निम्न कोड को चलाने का प्रयास कर सकते हैं।
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Demo {
class MyApplication {
static void Main(string[] args) {
double celsius;
double fahrenheit = 97;
Console.WriteLine("Fahrenheit: " + fahrenheit);
celsius = (fahrenheit - 32) * 5 / 9;
Console.WriteLine("Celsius: " + celsius);
Console.ReadLine();
}
}
} आउटपुट
Fahrenheit: 97 Celsius: 36.1111111111111