desislava_topuzakova

4. Размяна на стойности на променливи

Feb 26th, 2022
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _2._Change_variables_values
  4. {
  5. internal class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int a = int.Parse(Console.ReadLine());
  10. int b = int.Parse(Console.ReadLine());
  11.  
  12. Console.WriteLine("Before:");
  13. Console.WriteLine("a = " + a);
  14. Console.WriteLine("b = " + b);
  15.  
  16. int c = a;
  17. a = b;
  18. b = c;
  19.  
  20. Console.WriteLine("After:");
  21. Console.WriteLine("a = " + a);
  22. Console.WriteLine("b = " + b);
  23. }
  24. }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment