Advertisement
Guest User

Untitled

a guest
Mar 20th, 2014
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. using System;
  2.  
  3. class TwoIntsExchangesValues
  4. {
  5.     static void Main()
  6.     {
  7.         Console.WriteLine("Enter first number");
  8.         int a = int.Parse(Console.ReadLine ());
  9.         Console.WriteLine("Enter second number");
  10.         int b = int.Parse(Console.ReadLine ());
  11.  
  12.         int c = new int();
  13.  
  14.         if (a > b)
  15.         {
  16.             c = b;
  17.             b = a;
  18.             a = c;
  19.  
  20.             Console.WriteLine();
  21.             Console.WriteLine(a);
  22.             Console.WriteLine(b);
  23.         }
  24.         else
  25.         {
  26.            Console.WriteLine();
  27.            Console.WriteLine(a);
  28.            Console.WriteLine(b);
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement