Advertisement
Guest User

Untitled

a guest
Aug 27th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace MethodsPractice
  8. {
  9. class Program
  10. {
  11. static string SwitchName(string x, string y)
  12. {
  13.  
  14. string firstName = x;
  15. string lastName = y;
  16.  
  17. string temp = firstName;
  18.  
  19. firstName = lastName;
  20. lastName = temp;
  21.  
  22. string final = ("{0},{1}", firstName, lastName)
  23.  
  24.  
  25.  
  26. return final;
  27.  
  28. }
  29.  
  30.  
  31. static void Main(string[] args)
  32. {
  33. string nameReversed = "";
  34. string first = "Tim";
  35. string last = "Stern";
  36. nameReversed = SwitchName(first, last);
  37.  
  38. Console.WriteLine(nameReversed);
  39. Console.ReadKey(true);
  40.  
  41. }
  42.  
  43.  
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement