Skip to main content

Thread: Bubble Sort In C#


hi guys writing program, trying to, learning program. writing console application allows user input 10 numbers, , want sort them , use bubble sort.

here code:

using system;
using system.collections.generic;
using system.linq;
using system.text;
namespace task2
{
classtask2
{
staticvoid main(string[] args)
{
int[] numbers = newint[10];
int index = 0;
string enterednumber = "";
// read numbers entered user
for (index = 0; index < 10; index++)
{
console.write("enter number:");
enterednumber =
console.readline();
numbers[index] =
int.parse(enterednumber);
}
// sort numbers
bubblesort(numbers);
// display sorted numbers
console.writeline("the sorted numbers are:");
foreach (int num in numbers)
{
console.write(num + " ");
}
console.readline(); // pause
}
// bubblesort function
staticvoid bubblesort(int[] numbers)
{
bool swapped = true;
int count = 1;
// write bubble sort code flowchart here!!
}
}
}

cant figure out how start, can give me suggestion please or start code or something?

seems homework? flowchart refers to?


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Bubble Sort In C#


Ubuntu

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account