#include <stdio.h>
void main()
{
int a[100],b[100],s[100];
int i,j;
int n,temp;
printf("How many numbers do you want to input? : ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("Enter %d number of first list : ",i+1);
scanf("%d",&a[i]);
}
printf("\n\n");
for(i=0;i<n;i++)
{
printf("Enter %d number of second list : ",i+1);
scanf("%d",&b[i]);
}
for(i=0;i<n;i++)
{
s[i] = a[i] + b[i];
}
printf("\n\n....... the sum of arrays........\n\n");
for(i=0;i<n;i++)
{
printf("%d ",s[i]);
}
printf("\n\n...... arranging the sum in ascending order...\n\n");
for (i = 0; i < n; ++i)
{
for (j = i + 1; j < n; ++j)
{
if (s[i] > s[j])
{
temp = s[i];
s[i] = s[j];
s[j] = temp;
}
}
}
for (i=0;i<n;i++)
{
printf("%d ",s[i]);
}
getch();
}