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