Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
buble sort
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int[] a = { 30, 20, 50, 40, 10 }; int t; Console.WriteLine("The Array is : "); for (int i = 0; i < a.Length; i++) { Console.WriteLine(a[i]); } for (int j = 0; j <= a.Length - 2; j++) { for (int i = 0; i <= a.Length - 2; i++) { if (a[i] > a[i + 1]) { t = a[i + 1]; a[i + 1] = a[i]; a[i] = t; } } } Console.WriteLine("The Sorted Array :"); foreach (int aray in a) Console.Write(aray + " "); Console.ReadLine(); } } }
run
|
edit
|
history
|
help
1
Testing 008
Collection Basic
C# program to Determine if Two Words Are Anagrams of Each Other
selam
438935
Random number between 1 - 100 between each value of 10 there will be a differnt message
a6
rzError
QQW
sdfgtfgb