From 7a18f3d65637ea4b46f7cd682de551f3998e3f15 Mon Sep 17 00:00:00 2001 From: Uma-12345 <72243422+Uma-12345@users.noreply.github.com> Date: Fri, 16 Oct 2020 02:33:21 -0700 Subject: [PATCH] Create Sort.c --- Sort.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Sort.c diff --git a/Sort.c b/Sort.c new file mode 100644 index 0000000..cbc6e13 --- /dev/null +++ b/Sort.c @@ -0,0 +1,19 @@ +void isort(float d[], int size) +{ + int i,k,l; + float temp; + for(k=1;ki;l--) d[l]=d[l-1]; // shift to make room to insert at ith + d[i]=temp; //insert kth element to ith place + } +} + +void main(){ + int i; + float data[]={9,8,7,6,5,4,-13,2,1,0,1,2,3}; + isort(data,13); + printf("\n"); + for(i=0;i<13;i++) printf("%f\t",data[i]); +}