Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PregatireExamen {
- class Swaping {
- public void swap(ref int x, ref int y) {
- int a, b; a = x; b = y; swap2(ref a, ref b);
- }
- public void swap2(ref int a, ref int b) {
- int temp; temp = a; a = b; b = a;
- }
- static void Main(string[] args) {
- Swaping n = new Swaping();
- int a = 100;
- int b = 200;
- n.swap(ref a, ref b);
- Console.WriteLine(a+" "+b);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement