diff --git a/arrays/sorting/bubble-sort/bubble-sort.c b/arrays/sorting/bubble-sort/bubble-sort.c new file mode 100644 index 0000000..855a103 --- /dev/null +++ b/arrays/sorting/bubble-sort/bubble-sort.c @@ -0,0 +1,25 @@ +#include +void main() +{ + int n,arr[50],temp,i,j; + printf("\n\n\t\t\t\t Bubble Sort\n--------------------------------------------------------------------------------\n"); + printf("\n\n Enter the limit : "); + scanf("%d", &n); + printf("\n Enter the elements to the array \n\n"); + for (i=0;i arr[j+1]){ + temp = arr[j]; + arr[j] = arr[j+1]; + arr[j+1] = temp; + } + } + printf("\n\t\t\t\t Sorted Array\n--------------------------------------------------------------------------------\n"); + for (i=0;i