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