Showing posts with label int to Decimal Datatype Conversion. Show all posts
Showing posts with label int to Decimal Datatype Conversion. Show all posts

Tuesday, April 26, 2016

int to Decimal Datatype Conversion

using System;
namespace TypeConversionApplication 
{
 class ExplicitConversion 
 {
 static void Main(string[] args) 
 {
 int a = 20;
 decimal b = Convert.ToDecimal(a);
 Console.WriteLine(b);
 Console.ReadKey();
 }
 }
}
Output : 20
 int to Double Datatype
using System;
namespace TypeConversionApplication 
{
 class ExplicitConversion 
 {
 static void Main(string[] args) 
 {
 int a = 30;
 double b = Convert.ToDouble(a);
 Console.WriteLine(b);
 Console.ReadKey();
 }
 }
}
Output : 30