- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
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
Advertisements