using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Currency
{
class Program
{
static void Main(string[] args)
{
double euro,ans;
Console.Write("What is 20.5 euro + 20 euro :");
ans=Convert.ToDouble(Console.ReadLine());
euro = ans;
Console.WriteLine("\nThe ans is {0:C}", euro);
// the output is what is 20.5 euro + 20 euro :
//The ans is ? 40.5
VulpesPosted Oct 26, 2013, 9:19 AM
}
Kiran Kumar TalikotiPosted Oct 26, 2013, 6:29 AM
Try this code
Input : 20 and 20.5
Output: 40.5
class Program
{
static void Main(string[] args)
{
double euro, ans1,ans2;
Console.Write("What is 20.5 euro + 20 euro :");
ans1 = Convert.ToDouble(Console.ReadLine());
ans2 = Convert.ToDouble(Console.ReadLine());
euro = ans1+ans2;
Console.WriteLine("\nThe ans is {0:C}", euro);
Console.ReadKey();
}
}
I hope this helps you