{
double heightDouble = 1.825;
float heightFloat;
int heightInt;
heightFloat = heightDouble;
heightInt = (int)heightFloat;
Console.Write("heightInt is " + heightInt + " and heightFloat is " + heightFloat);
}
Loading
Sanwar RanwaPosted Nov 26, 2018, 5:25 AM
Asma KhalidPosted Nov 26, 2018, 6:41 AM
1) C# "Convert" Method (Recommended)
2) Simple Type Casting