สมมติว่าคุณต้องได้มูลค่า 10 ดอลลาร์เป็น INR
Firstly, set the variables: double usd, inr, val;
ตอนนี้ตั้งค่าดอลลาร์และแปลงเป็น INR
// 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