Advertisement
KodingKid

Maths in C#

Mar 24th, 2021
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. int x = 7;
  2. int y = 1;
  3. int addition = x + y;
  4. Console.WriteLine(addition);
  5. //adds int x and int y
  6. int x = 9;
  7. int y = 2;
  8. int multiplication = x * y;
  9. Console.WriteLine(multiplication);
  10. //multiplies int x and int y
  11. int x = 3;
  12. int y = 3;
  13. int subtraction = x - y;
  14. Console.WriteLine(subtraction);
  15. //subtracts int x and int y
  16. int x = 2;
  17. int y = 7;
  18. int division = x / y;
  19. Console.WriteLine(division);
  20. //divides int x and int y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement