diff --git a/Sorting Algorithm/BubbleSort.c b/Sorting Algorithm/BubbleSort.c new file mode 100644 index 0000000..2a2cd86 --- /dev/null +++ b/Sorting Algorithm/BubbleSort.c @@ -0,0 +1,39 @@ +#include +#include +void bubblesort(int a[],int size); +void main() +{ + int a[50],n,i; + printf("\n Enter the size of the array"); + scanf("%d",&n); + if(n>50) + { + printf("\n error"); + exit(0); + } + + printf("\n Enter the array elements: \n"); + + for(i=0;ia[j+1]) + { + temp=a[j]; + a[j]=a[j+1]; + a[j+1]=temp; + } + } + } +}