#include<stdio.h> #include<conio.h> int main() { int arr1[50], arr2[50], size1, size2, i, k, merge[100]; printf("Enter Array 1 Size: "); scanf("%d", &size1); printf("Enter Array 1 Elements: "); for(i=0; i<size1; i++) { scanf("%d", &arr1[i]); merge[i] = arr1[i]; } k = i; printf("\nEnter Array 2 Size: "); scanf("%d", &size2); printf("Enter Array 2 Elements: "); for(i=0; i<size2; i++) { scanf("%d", &arr2[i]); merge[k] = arr2[i]; k++; } printf("\nAfter Merging\n"); for(i=0; i<k; i++) printf("%d ", merge[i]); getch(); return 0; }
C program to merge two arrays.
Reviewed by
on
December 25, 2019
Rating:
No comments: