C# Program to perform Currency Conversion

CsharpProgrammingServer Side Programming

Let’s say you need to get the value of 10 dollars in INR.

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

Now set the dollars and convert it to INR.

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

Let us see the complete code −

Example

 Live Demo

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);
      }
   }
}

Output

10 Dollar = 690 INR
raja
Published on 20-Aug-2018 17:23:17
Advertisements