C# 程式用來執行貨幣轉換


假設你需要以印度盧比來獲取 10 美元的值。

Firstly, set the variables:
double usd, inr, val;

現在設定美元並將其轉換為印度盧比。

// how many dpllars
usd = 10;
// current value of US$
val = 69;
inr = usd * val;

讓我們看完整的程式碼 −

示例

 線上演示

using System;
namespace Demo {
   public class Program {
      public static void Main(string[] args) {
         Double usd, inr, val;
         // how many dpllars
         usd = 10;
         // current value of US$
         val = 69;
         inr = usd * val;
         Console.WriteLine("{0} Dollar = {1} INR", usd, inr);
      }
   }
}

輸出

10 Dollar = 690 INR

更新於: 22-6 月-2020

4K+ 觀看

開啟你的 職業生涯

透過完成該課程獲得認證

入門
廣告
© . All rights reserved.