fbinnzhivko

17.00 Exchange Variable Values

May 28th, 2016
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.34 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         int a = int.Parse(Console.ReadLine());
  7.         int b = int.Parse(Console.ReadLine());
  8.         Console.WriteLine("Before:\na = {0}\nb = {1}", a, b);
  9.  
  10.         int c = b;
  11.         b = a;
  12.         a = c;
  13.         Console.WriteLine("After:\na = {0}\nb = {1}", a, b);
  14.     }
  15. }
Add Comment
Please, Sign In to add comment