From f8d6671690b74db51982d9f91dc11a7c72c5fca6 Mon Sep 17 00:00:00 2001 From: isha Date: Fri, 25 Oct 2019 19:17:14 +0530 Subject: [PATCH] adding the bubble sort --- bubble.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 bubble.c diff --git a/bubble.c b/bubble.c new file mode 100644 index 0000000..c02ebbc --- /dev/null +++ b/bubble.c @@ -0,0 +1,25 @@ +#include +int main() +{ + int i,j,n,t,a[100]; + printf(" enter no of arrary elements:"); + scanf("%d",&n); + printf("enter array elements:\n"); + for(i=0;ia[j+1]){ + t=a[j]; + a[j]=a[j+1]; + a[j+1]=t; + } + } + } + printf("bubble sorted program:"); + for(i=0;i