From 319d82b9ee7b3ab7335ce356419c4019a17ec057 Mon Sep 17 00:00:00 2001 From: Vaikuntram <95952585+Vaikuntram@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:56:51 +0530 Subject: [PATCH] Update bubble_sort.c --- C/bubble_sort.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/C/bubble_sort.c b/C/bubble_sort.c index 7e90845..4b4f4bb 100644 --- a/C/bubble_sort.c +++ b/C/bubble_sort.c @@ -1,14 +1,15 @@ #include -void main() +int main() { - int a[5],n,i,j,temp; + int n,i,j,temp; printf("Enter size of array : "); scanf("%d",&n); + int a[n]; printf("Enter %d elements ",n); for(i=0;i1;i--) + for(i=n;i>1;i--) { for(j=0;j