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