Interchange the values of two arrays OR Swap the values of two arrays

preview_player
Показать описание
Program should accept an array from the user, swap the values of two arrays and display it on the console
Рекомендации по теме
Комментарии
Автор

Write a program to interchange the values of two arrays
Program should accept an array from the user, swap the values of two arrays and display it on the console
?

abhilashraman
Автор

Source Code the program of Swap of two Array
#include <stdio.h>
#include <stdlib.h>

int main(void) {
int a[10], b[10], i, size, temp;
setbuf(stdout, NULL);
printf("Enter the size of the Array");
scanf("%d", &size);
printf("Enter the Fist Array Elements \n");
for (i=0;i<size;i++){
scanf("%d", &a[i]);
}
printf("\n");
printf("Enter the second Array Elements \n");
for (i=0;i<size;i++){
scanf("%d", &b[i]);
}
printf("\n");
printf("The elements in the First are \n");
for (i=0;i<size;i++){
printf("%d \t", a[i]);
}
printf("\n");
printf("The elements in the second are \n");
for (i=0;i<size;i++){
printf("%d \t", b[i]);
}
printf("\n");
for (i=0;i<size;i++){
temp = a[i];
a[i]=b[i];
b[i]=temp;

}
printf("The After sorting the Elements in First Array \n");
for (i=0;i<size;i++){
printf("%d \t", a[i]);
}
printf("\n");
printf("The After sorting the Elements in second Array \n");
for (i=0;i<size;i++){
\t", b[i]);
}

return EXIT_SUCCESS;
}

ajmalp.y
join shbcf.ru