explicit conversion in C#
For Example : Write a program to demonstrate the use of explicit conversion.
class Program
{
static void Main(string[]
args)
{
double
x = 4562.8568;
int
y;
y = (int)x; // here
convert double to int
Console.WriteLine(" Value of x is after converted: " + y);
Console.Read();
}
}
Output:
Comments
Post a Comment