C\ubble sort code

From , 5 Years ago, written in C#, viewed 140 times.
URL https://pastebin.vip/view/ea96efc0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.  
  13.             int[] arr =new int[]{1,3,2,4,5,2,4,23,4,23,5,3,52,32};
  14.  
  15.             int i, j, tmp;
  16.  
  17.             for (i = 0; i < arr.Length; i++) {
  18.  
  19.                 for (j = 0; j < arr.Length - 1 - i; j++) {
  20.  
  21.                     if (arr[j] < arr[j + 1]) {
  22.  
  23.                         tmp = arr[j];
  24.                         arr[j]=arr[j + 1];
  25.                         arr[j + 1] = tmp;
  26.  
  27.                     }
  28.                 }
  29.  
  30.             }
  31.  
  32.             for (i = 0; i < arr.Length; i++) {
  33.  
  34.                 Console.Write(arr[i]);
  35.  
  36.             }
  37.                 Console.ReadLine();
  38.         }
  39.     }
  40. }
  41. //csharp/4888

Reply to "C\ubble sort code"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website