{
double heightDouble = 1.825;
float heightFloat;
int heightInt;
heightFloat = heightDouble;
heightInt = (int)heightFloat;
Console.Write("heightInt is " + heightInt + " and heightFloat is " + heightFloat);
}
Loading

Sanwar RanwaRank #23 · 44.7K reputationPosted Nov 26, 2018, 12:25 AM EST
Asma KhalidRank #160 · 14.7K reputationPosted Nov 26, 2018, 1:41 AM EST
1) C# "Convert" Method (Recommended)
2) Simple Type Casting