From c4f7b84a4d969ac44133ae3dd21c765d1cc6c997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B4=DB=8C=D8=AE=20=DB=8C=D8=A7=D9=88=D8=B1?= <64884232+Sheikh-Yawar@users.noreply.github.com> Date: Sun, 10 Oct 2021 11:27:05 +0530 Subject: [PATCH] Merging Two Sorted Arrays (#520) * Two Sum C solution * Merging Two Sorted Arrays --- .../MergingSortedArrays.c | 49 +++++++++++++++++++ Programming/C/Two Sum/TwoSum.c | 29 +++++++++++ 2 files changed, 78 insertions(+) create mode 100644 Programming/C/Merging Two sorted Arrays/MergingSortedArrays.c create mode 100644 Programming/C/Two Sum/TwoSum.c diff --git a/Programming/C/Merging Two sorted Arrays/MergingSortedArrays.c b/Programming/C/Merging Two sorted Arrays/MergingSortedArrays.c new file mode 100644 index 0000000..821220a --- /dev/null +++ b/Programming/C/Merging Two sorted Arrays/MergingSortedArrays.c @@ -0,0 +1,49 @@ +#include + +int main() +{ + + int n1,n2,n3; //Array Size Declaration + printf("\nEnter the size of first array "); + scanf("%d",&n1); + printf("\nEnter the size of second array "); + scanf("%d",&n2); + + n3=n1+n2; + printf("\nEnter the sorted array elements"); + int a[n1],b[n2],c[n3]; //Array Declaration + for(int i=0;ic[j]) + { + temp=c[i]; + c[i]=c[j]; + c[j]=temp; + } + } + } + + for(int i=0 ; i +#include +int main() +{ + int nums[100],i,j,size,target,sum=0; + printf("Enter the size of an array\n"); + scanf("%d",&size); + printf("Enter an array elements\n"); + for(i=0;i