In this article, we will create a C# Program to perform Currency Conversion.
You will also like this: Dollar / Euro Currency Exchange Rate Convertor in C# using JSON
C# Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | class Program { public static void Main() { int choice; double val,frank; Console.WriteLine("Enter your Choice :\n 1- Dollar to Frank \n 2- Euro to Frank \n 3- Sterling to Frank "); choice = int.Parse(Console.ReadLine()); switch (choice) { case 1: Double dollar; Console.Write("Enter the Dollar Amount :"); dollar = Double.Parse(Console.ReadLine()); Console.Write("Enter the Dollar Value :"); val = double.Parse(Console.ReadLine()); frank = dollar * val; Console.WriteLine("{0} Dollar Equals {1} Frank", dollar, frank); break; case 2: Double Euro; Console.Write("Enter the Euro Amount :"); Euro = Double.Parse(Console.ReadLine()); Console.Write("Enter the Euro Value :"); val = double.Parse(Console.ReadLine()); frank = Euro * val; Console.WriteLine("{0} Euro Equals {1} Frank", Euro, frank); break; case 3: Double sterling; Console.Write("Enter the Sterling Amount :"); sterling = Double.Parse(Console.ReadLine()); Console.Write("Enter the Sterling Value :"); val = double.Parse(Console.ReadLine()); frank = sterling * val; Console.WriteLine("{0} Sterling Equals {1} Frank", sterling, frank); break; } Console.ReadLine(); } } |
Output: