Advertisement
geniusvil

HW02_TASK02

Nov 11th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. using System;
  2.  
  3. class AssignType
  4. {
  5. static void Main()
  6. {
  7. /*Which of the following values can be assigned to a
  8. * variable of type float and which to a variable of
  9. * type double: 34.567839023, 12.345, 8923.1234857, 3456.091?
  10. */
  11.  
  12.  
  13. float a = 12.345f;
  14. float b = 3456.091f;
  15. double c = 8923.1234857;
  16. double d = 34.567839023;
  17. Console.WriteLine(d + ", " + a + ", " + c + ", " + b);
  18. Console.WriteLine();
  19. //other way to be printed
  20. Console.WriteLine("{0}, {1}, {2}, {3}", d, a, c, b);
  21. Console.WriteLine();
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement