Complete the code to declare a variable of type float.
[1] number = 3.14f;
In C#, to declare a float variable, you use the float keyword and suffix the number with f.
Complete the code to declare a variable of type double.
[1] value = 3.14159;
Double is the default type for floating-point numbers without suffix in C#. Use double keyword to declare.
Complete the code to declare a variable of type decimal.
[1] price = 19.99m;
Decimal variables require the decimal keyword and the number must have an m suffix.
Fill both blanks to declare a float and a decimal variable correctly.
float pi = [1][2]; decimal cost = 9.99m;
For float, the number must be followed by f suffix. The number itself is 3.14.
Fill all three blanks to declare variables of float and double types correctly.
[1] f = 3.5[2]; [3] d = 6.7;
Float literals need the 'f' suffix. Double variables use the double keyword and no suffix.