C# 程式執行攝氏度轉華氏度
首先,設定攝氏度 −
double celsius = 36;
Console.WriteLine("Celsius: " + celsius);現在將其轉換為華氏度
fahrenheit = (celsius * 9) / 5 + 32;
您可以嘗試執行以下程式碼來將攝氏度轉換為華氏度。
示例
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Demo {
class MyApplication {
static void Main(string[] args) {
double fahrenheit;
double celsius = 36;
Console.WriteLine("Celsius: " + celsius);
fahrenheit = (celsius * 9) / 5 + 32;
Console.WriteLine("Fahrenheit: " + fahrenheit);
Console.ReadLine();
}
}
}輸出
Celsius: 36 Fahrenheit: 96.8
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP