From 11fa9a1c5f861f50408dc40ad41f0dc38e19adcf Mon Sep 17 00:00:00 2001 From: Chetan Kaushik Date: Sat, 3 Sep 2016 22:28:04 +0530 Subject: [PATCH] Create BubbleSort.c --- BubbleSort.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 BubbleSort.c diff --git a/BubbleSort.c b/BubbleSort.c new file mode 100644 index 00000000..0621c516 --- /dev/null +++ b/BubbleSort.c @@ -0,0 +1,35 @@ +/* ALGORITHM +1. Start from left hand side +2. Compare first two numbers +3. If first_number > second_number than swap both number position. And if first_number < second_number than these compare next two numbers i.e. second_number and third_number. +4. Step-3 process repeat until there are no more numbers left to compared. +*/ + +#include +#include +#define SIZE 7 +int main() +{ + int i,j,temp; + int arr[ SIZE ]; + for(i=0; i