v1ppers0nn

Exchange If Greater

Apr 10th, 2014
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2.  
  3. class ExchangeIfGreater
  4. {
  5.     static void Main()
  6.     {
  7.         Console.WriteLine("Enter two numbers: ");
  8.         double a = double.Parse(Console.ReadLine());
  9.         double b = double.Parse(Console.ReadLine());
  10.  
  11.         if (a > b)
  12.         {
  13.             Console.WriteLine(b + " " + a);
  14.         }
  15.         else
  16.         {
  17.             Console.WriteLine(a + " " + b);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment