Answers for "Type Conversion Methods"

C#
0

Type Conversion Methods

int myInt = 10;
double myDouble = 5.25;
bool myBool = true;

Console.WriteLine(Convert.ToString(myInt));    // convert int to string
Console.WriteLine(Convert.ToDouble(myInt));    // convert int to double
Console.WriteLine(Convert.ToInt32(myDouble));  // convert double to int
Console.WriteLine(Convert.ToString(myBool));   // convert bool to string
Posted by: Guest on May-31-2021

Code answers related to "Type Conversion Methods"

C# Answers by Framework

Browse Popular Code Answers by Language