Horje
intersection.cpp Code Example
intersection.cpp
#include"iostream"

using namespace std;


int A[] = {2, 4, 3, 5, 6, 7};
int B[] = {9, 2, 7, 6};

int main()
{
    int sizeA = sizeof(A)/sizeof(int);

    int sizeB = sizeof(B)/sizeof(int);

    int big =  (sizeA > sizeB) ? sizeA : sizeB;

    int small =  (sizeA > sizeB) ? sizeB : sizeA;

    for (int i = 0; i <big ;++i)
    {
        for (int j = 0; j <small ; ++j)
        {
            if(A[i] == B[j])
            {
                cout<<"Element is -->"<<A[i]<<endl;
            }
        }
    }

    return 0;
}




Cpp

Related
c ++ split_string Code Example c ++ split_string Code Example
c++ print unsigned long Code Example c++ print unsigned long Code Example
tuple vector c++ Code Example tuple vector c++ Code Example
c++ check if vector is sorted Code Example c++ check if vector is sorted Code Example
what is throw in c++ Code Example what is throw in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
15