We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd7671d commit c8dd3aaCopy full SHA for c8dd3aa
CommonElementsInTwoArrays.c
@@ -0,0 +1,26 @@
1
+#include<stdio.h>
2
+int main()
3
+{
4
+ int i,j,n;
5
+ printf("enter the number of elements in an arrays\n");
6
+ scanf("%d",&n);
7
+ int a[n],b[n];
8
+ printf("enter the elements of 1st array\n");
9
+ for(i=0;i<n;i++)
10
+ {
11
+ scanf("%d",&a[i]);
12
+ }
13
+ printf("enter the elements of 2nd array\n");
14
+ for(j=0;j<n;j++)
15
16
+ scanf("%d",&b[j]);
17
18
+ printf("The common numbers are: ");
19
+ for(i=0; i<n; i++){
20
+ for(j=0;j<n;j++){
21
+ if(a[i]==b[j]){
22
+ printf("%d\n", b[j]);
23
24
25
26
+}
0 commit comments