Hello guys, I've been watching this forum for the past 2 weeks and I can say you do a nice job here.
I know this have been posted a million times, but i still can't solve my problem.
Code:
#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>
#include <stdlib.h>
int main()
{
int a[10],b[10],c[10],i,j,k,n,m;
printf ("Enter the size of the first vector: ");
scanf ("%d", &n);
for ( i=0 ; i<n ; i++)
{
printf ("a[%d]= ", i);
scanf ("%d", &a[i]);
}
printf ("Enter the size of the second vector: ");
scanf ("%d", &m);
for ( j=0 ; j<m ; j++)
{
printf ("b[%d]= ", j);
scanf ("%d", &b[i]);
}
if ( a[i] == b[j] )
{
printf ("a[%d]", i);
}
system("pause");
}
Now, this is what I've been able to do so far, i know it's very basic but I just started learning programming! I tried different methods found on internet but none of them work for me. I want to find the intersection of arrays a & b then put them in array c(or just display them?)
Thanks in advance!