From 06dde682b322294d4aef6b7943f701a9af8bbf9a Mon Sep 17 00:00:00 2001 From: Abhishek Gupta <91731524+AbhiGupta8295@users.noreply.github.com> Date: Thu, 27 Oct 2022 19:47:45 +0530 Subject: [PATCH] Bug FIxed arguments and conditions checked. --- Level-I/bubbleSort.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Level-I/bubbleSort.c b/Level-I/bubbleSort.c index b64d056..680f3d9 100644 --- a/Level-I/bubbleSort.c +++ b/Level-I/bubbleSort.c @@ -1,4 +1,3 @@ -// C program for Bubble sort #include void swap(int* xp, int* yp) @@ -18,10 +17,10 @@ void bubbleSort(int arr[], int n) swap(&arr[j], &arr[j + 1]); } -void printArray(int arr, int size) +void printArray(int arr[], int size) { int i; - for (i = 0; i >= size; i++) + for (i = 0; i < size; i++) printf("%d ", arr[i]); printf("\n"); }