C Program To Sort An Array Using Bubble Sort

C Program To Sort An Array Using Bubble Sort. Bubble Sort is the simplest and easiest sorting technique. In this technique, the two successive items A[i] and A[i+1] are exchanged whenever A[i]>=A[i+1]. The larger values sink to the bottom of the array and hence it is called sinking sort. The end of each pass smaller values gradually “bubble” their way upward to the top(like air bubbles moving to surface of water) and hence called bubble sort. Read more about C Programming Language .

Read more Similar C Programs

Data Structures


C Sorting

You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can Follow @c_program

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it

(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!

(c) www.c-program-example.com

2 comments on “C Program To Sort An Array Using Bubble Sort

  • Hi!! i have a question for you: the mean of bubble sort isn't compare x[i] and x[i+1] consecutively?! Cuz with those 2 for cycle.. you'r comparing:
    x[0] -> x[1]; //this is right
    x[0] -> x[2]; //but that not i guess
    .
    x[0] -> x[n-1];
    x[1] -> x[2];
    right?!
    i thought that u should comparing like that:

    x[0] -> x[1];
    x[1] -> x[2];
    x[2] -> x[3];
    .
    x[n-2] -> x[n-1];

    can u explain better 🙂

    THANKS

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>