daily pastebin goal
8%
SHARE
TWEET

Untitled

ostyleo Jan 20th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace PregatireExamen {
  8.     class Swaping {
  9.         public void swap(ref int x, ref int y) {
  10.             int a, b; a = x; b = y; swap2(ref a, ref b);
  11.         }
  12.         public void swap2(ref int a, ref int b) {
  13.             int temp; temp = a; a = b; b = a;
  14.         }
  15.         static void Main(string[] args) {
  16.             Swaping n = new Swaping();
  17.             int a = 100;
  18.             int b = 200;
  19.             n.swap(ref a, ref b);
  20.             Console.WriteLine(a+" "+b);
  21.         }
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top