From 8039e732ba98c1ce4760fa0d6b719577164808bb Mon Sep 17 00:00:00 2001 From: diyaannathoma2 <56103564+diyaannathoma2@users.noreply.github.com> Date: Sun, 20 Oct 2019 10:54:47 +0530 Subject: [PATCH] Add files via upload --- 3.Selectionsort.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 3.Selectionsort.c diff --git a/3.Selectionsort.c b/3.Selectionsort.c new file mode 100644 index 0000000..1532490 --- /dev/null +++ b/3.Selectionsort.c @@ -0,0 +1,29 @@ +#include +void main() +{ + int a[100],i,j,pos,n,swap; + printf("Enter the limit:"); + scanf("%d",&n); + for(i=0;ia[j]) + { + pos=j; + } + } + if(pos!=i) + { + swap=a[i]; + a[i]=a[pos]; + a[pos]=swap; + + } + } + for(i=0;i