প্রথমে, ফারেনহাইট তাপমাত্রা সেট করুন −
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