C# Program to perform Currency Conversion


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

Updated on: 22-Jun-2020

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements