Answers for "Converting to Different data Type"

C#
0

Converting to Different data Type

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 "Converting to Different data Type"

C# Answers by Framework

Browse Popular Code Answers by Language