Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class AssignType
- {
- static void Main()
- {
- /*Which of the following values can be assigned to a
- * variable of type float and which to a variable of
- * type double: 34.567839023, 12.345, 8923.1234857, 3456.091?
- */
- float a = 12.345f;
- float b = 3456.091f;
- double c = 8923.1234857;
- double d = 34.567839023;
- Console.WriteLine(d + ", " + a + ", " + c + ", " + b);
- Console.WriteLine();
- //other way to be printed
- Console.WriteLine("{0}, {1}, {2}, {3}", d, a, c, b);
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement