Q:

C# program to convert the US dollar into Indian rupees

belongs to collection: C# Basic Programs | basics

0

C# program to convert the US dollar into Indian rupees

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program:

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.

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C# Basic Programs | basics

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
C# program to print digits of a number into words... >>
<< C# program to convert entered days into years, wee...