We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3bd9f64 commit 115d6fbCopy full SHA for 115d6fb
arrayinsertionsort.c
@@ -0,0 +1,28 @@
1
+#include<stdio.h>
2
+void main()
3
+{
4
+int a[50],n,i,j,temp;
5
+printf("Enter the number of elements\n");
6
+scanf("%d",&n);
7
+printf("Enter the elements of array\n");
8
+for(i=0;i<n;i++)
9
10
+ scanf("%d",&a[i]);
11
+}
12
13
14
+ for(j=0;j<n;j++)
15
+ {
16
+ if(a[i]<a[j])
17
18
+ temp=a[i];
19
+ a[i]=a[j];
20
+ a[j]=temp;
21
+ }
22
23
24
25
26
+ printf(" %d",a[i]);
27
28
0 commit comments