Advertisement
Gesh4o

NullValuesArithmetic

Aug 27th, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. using System;
  2.  
  3. class NullValuesArithmetic
  4. {
  5. static void Main()
  6. {
  7. //Create a program that assigns null values to an integer and to a double variable. Try to print these variables at the console.
  8. //Try to add some number or the null literal to these variables and print the result
  9. int? number0 = null;
  10. double? number1 = null;
  11. Console.WriteLine(number0);
  12. Console.WriteLine(number1);
  13. Console.WriteLine(number0 + 2);
  14. Console.WriteLine(number1 + null);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement