C# program to convert the US dollar into Indian rupees

Here, we are going to learn how to convert the US dollar into Indian rupees in C#? By Nidhi Last updated : April 15, 2023

Us Dollar into Indian Rupees Conversion

Here we will read the amount into the US dollar and then enter the current value of the US dollar and then convert the amount into Indian rupees.

C# code for US dollar into Indian rupees conversion

The source code to convert the US dollar into Indian rupees is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.

//C# program to convert US dollar into Indian rupees.

using System;

class Program
{
    static void Main(string[] args)
    {
            
        double usd    = 0;
        double inr    = 0;
        double value  = 0;
            
        Console.Write("Enter amount in USD: ");
        usd = double.Parse(Console.ReadLine());
            
        Console.Write("Enter the USD value :");
        value = double.Parse(Console.ReadLine());
           
        inr = usd * value;
        Console.WriteLine("USD "+usd+"-> INR "+inr);
    }
}

Output

Enter amount in USD: 35.2
Enter the USD value :72.3
USD 35.2-> INR 2544.96
Press any key to continue . . .

Explanation

In the above program, we created a class Program that contains the Main() method. In the Main() method, we read the amount into the US dollar and then enter the current value of the US dollar and then convert the amount into Indian rupees.

C# Basic Programs »


Related Programs




Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.