Write a C# code to Convert following currency conversion.
Rupees to dollar, franc, euro.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CurrencyConversion
{
class Program
{
static void Main(string[] args)
{
int choice;
Console.WriteLine("Enter your Choice :\n 1- Rupees to Dollar \n 2- Rupees to Euro \n 3- Rupees to Franc ");
choice = int.Parse(Console.ReadLine());
switch (choice)
{
case 1:
Double dollar, rupee, val;
Console.WriteLine("Enter the Rupees Amount :");
dollar = Double.Parse(Console.ReadLine());
Console.WriteLine("Enter the Dollar Value :");
val = double.Parse(Console.ReadLine());
rupee = dollar / val;
Console.WriteLine("{0} Dollar Equals {1} Rupees", rupee, dollar);
break;
case 2:
Double Euro, rupe, valu;
Console.WriteLine("Enter the Rupees Amount :");
Euro = Double.Parse(Console.ReadLine());
Console.WriteLine("Enter the Euro Value :");
valu = double.Parse(Console.ReadLine());
rupe = Euro / valu;
Console.WriteLine("{0} Euro Equals {1} Rupees", rupe, Euro);
break;
case 3:
Double franc, rup, value;
Console.WriteLine("Enter the Rupees Amount :");
franc = Double.Parse(Console.ReadLine());
Console.WriteLine("Enter the Franc Value :");
value = double.Parse(Console.ReadLine());
rup = franc / value;
Console.WriteLine("{0} Franc Equals {1} Rupees", rup,franc);
break;
}
Console.ReadLine();
}
}
}
Output:
Enter your Choice :
1- Rupees to Dollar
2- Rupees to Euro
3- Rupees to Franc
1
Enter the Rupees Amount :
64
Enter the Dollar Value :
64
1 Dollar Equals 64 Rupees