## Monday, 10 September 2018

### What is sorting ?

The term sorting means arrangement of element in particular order i.e in ascending or descending  order is known as sorting.

Example:: 45,55,25,35,65
Sorted data :: 25,35,45,55,65

### How bubble sort work ?

Bubble sort method works on method of comparing two consecutive digits.

45,55,25,35,65

working::
45,55,25,35,65
45,25,55,35,65
25,45,55,35,65
25,45,35,55,65
25,35,45,55,65   ( sorted data )

### Program for bubble sort in c

#include<stdio.h>
#include<conio.h>
void main ()
{
int i,j,n,t,a[100];
clrscr ();
printf ("\n Enter size of array:");
scanf ("%d", &n);
printf ("\n Enter element in array:");
for (i=0;i<n;i++)
{
scanf ("%d", &a[i]);
}
for (i=o;i<n-1;i++)
{
for (j=0;j<n-i-1;j++)
{
if (a[j]>a[j+1])
{
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
}
}
printf (sorted array=");
for (i=0;i<n;i++)
{
printf ("\t %d",a[i]);
}
getch ();
}

1. I am sure this is very useful because I have learnt alot just from reading this sorting.

2. Hmmm. Interesting but I really dont understand it!

3. I am sure this will be helpful for a programmer.

5. I took a programming course in college, it is very complicated.

6. TBH hurts my brain!! Hahah props to you!

7. Thanks to your posts, I am starting to get motivated to learn coding. :)

8. This is really helps to all of beginner programmers! Nice one.

9. Goodness, this is too techy for me

10. Oh wow, all but greek to me. But really interested in coding. Thanks a lot for such an informative post.

11. English please....this makes me want to learn coding.....

12. Wow this is another level of programming language. Very interesting!

13. I don’t understand this at all. Maybe next time explain it in layman’s terms

14. I don't understand this really ut I know it would be helpful to someone someday.

15. I just stared at this for so long trying to understand lol But i'm sure it's helpful for others.

## Featured post

### Program to find Volume of given box in java

class volume { public static void main (String args []) { int l=5,b=6,h=10; int volume; volume=l*b*h; System.out.println (" vol...