-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path01.c
More file actions
49 lines (40 loc) · 884 Bytes
/
01.c
File metadata and controls
49 lines (40 loc) · 884 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include<stdio.h>
int main()
{
int num[5], num2[5], temp, i, j, k, l;
int a[10], b[5];
printf("Enter elements of 1st array\n");
for(i=0;i<5;i++)
{
printf("Enter Number-%d : ",i+1);
scanf("%d",&num[i]);
}
printf("Enter elements of 2nd array\n");
for(i=0;i<5;i++)
{
printf("Enter Number-%d : ",i+1);
scanf("%d",&num2[i]);
}
for(i=0; i<5; i++){
a[i]=num[i];
}
for(i=0; i<5; i++){
a[i+4]=num2[i];
}
for(i=0; i<9; i++)
{
for(j=0; j<9; j++)
{
if(a[j] >= a[j+1])
{
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
}
}
printf("\n\nIn Ascending Order...\n");
for(i=0; i<10; i++)
printf("Number-%d : %d\n",i+1,a[i]);
return 0;
}