You are on page 1of 2

3.

Currency conversion program in C#


Register No:11306621054
MC 1803 - xml and web services lab
M

using System;
using System.Collections.Generic;
using System.Text;
u

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int a;
double amt, d, e, r, y;
do
{
Console.WriteLine("1.Dollar");
Console.WriteLine("2.Euro");
Console.WriteLine("3.POUNDS");
Console.WriteLine("Enter ur choice");
a = int.Parse(Console.ReadLine());
switch(a)
{
case 1:
Console.WriteLine("Enter the value to be converted:
");
d = double.Parse(Console.ReadLine());
amt = d / 41.50;
Console.WriteLine("\nDollars=" + Math.Round(amt,2));
break;

case 2:
Console.WriteLine("Enter the value to be
converted: ");
e = double.Parse(Console.ReadLine());
amt = e / 72.10;
Console.WriteLine("\nEuro=" + Math.Round(amt,2));
break;

case 3:
Console.WriteLine("Enter the value to be converted:
");
r = double.Parse(Console.ReadLine());
amt = r / 36;
Console.WriteLine("\npounds=" + Math.Round(amt,3));
break;
}

} while (a < 4);


}
}

You might also like