In this program lets see how to convert to double
using System;
namespace doubledemo
{
class class1
{
static void Main()
{
double inum1,inum2,add;
Console.WriteLine("enter a no");
inum1=Convert.ToDouble(Console.ReadLine());
Console.WriteLine("enter a second no.");
inum2=Convert.ToDouble(Console.ReadLine());
add=inum1+inum2;
Console.WriteLine("Result ="+add.ToString());
}
}
}
No comments:
Post a Comment