sum of array using function
sum of array using function
h>
int main(){
int n,m;
printf("enter the size of first array");
scanf("%d",&n);
printf("enter the size of second array");
scanf("%d",&m);
int a[n];
int b[m];
int d=m+n;
int c[d];
for(int i = 0;i<n;i++){
printf("enter the elements for first array");
scanf("%d",&a[i]);
}
for(int i = 0;i<m;i++){
printf("enter the elements for second array");
scanf("%d",&b[i]);
}
for(int i = 0;i<n;i++){
c[i]=a[i];
}
for(int i = 0;i<d;i++){
c[i+n]=b[i];
for(int i = 0;i<d;i++){
printf("%d",c[i]);
}
for(int i = 0;i<d;i++){
for(int j = 0;j<d;j++){
if(i == j){
continue;
}
else if(c[j]>c[i]){
int temp = c[i];
c[i] = c[j];
c[j] = temp;
}
}
}
for(int i = 0;i<d;i++){
printf("%d",c[i]);
}