C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//C Program To Sort A Given Array Of Numbers In Ascending Order
/*NOTE : While you give inputs, first input size of array i.e. how many numbers you want to enter and then type the elements (in new line)
Example :
4
6
2
0
7
*/
#include <stdio.h>
int main() {
int a[20],size,i;
//printf("Enter the size of array : ");
scanf("%d",&size);
//printf("Enter the elements of array : ");
for(i=0; i<size; i++)
scanf("%d",&a[i]);
printf("Entered array of numbers is : \n");
for(i=0; i<size;i++)
{
printf("%d\t",a[i]);
}
sort(a, size);
}
void sort(int arr[], int s)
{
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run