I have changed up my code to be vectors. Now I am trying to find the Union, Intersection, and A-B. My code for both Union and Intersection now is working. I can not figure out how to do my difference. I figured I could take A and if it == to B then not insert it but it still puts them in none the less.
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>
#include <algorithm>
using namespace std;
void Union();
void Intersection();
void Difference();
int main()
{
    Union();
    Intersection();
    Difference();
    return 0;
}
void SetVectors()
{
}
void Union()
{
        int temp = 0;
vector<int> U{};
vector<int> A{3, 4, 9, 12, 13, 15, 16, 17};
vector<int> B{1, 3, 5, 7, 9};
for(int i = 0; i < A.size(); i++)
{
    for (int j = 0; j < B.size(); j++)
    {
        if (A[i] != B[j])
        {
            int temp = A[i];
            U.push_back(temp);
            temp = B[j];
            U.push_back(temp);
        }
              //Used To Sort The Vector So There Is No Duplicates And Its In Order!
              sort( U.begin(), U.end() );
              U.erase( unique( U.begin(), U.end() ), U.end() );
    }
}
cout << "Union: ";
for(int z = 0; z < U.size(); z++)
{
    cout << U[z] << " ";
}
}
void Intersection()
{
        int temp = 0;
vector<int> U{};
vector<int> A{3, 4, 9, 12, 13, 15};
//Used To Sort The Vector So There Is No Duplicates And Its In Order!
sort( A.begin(), A.end() );
A.erase( unique( A.begin(), A.end() ), A.end() );
vector<int> B{1, 3, 5, 7, 9};
//Used To Sort The Vector So There Is No Duplicates And Its In Order!
sort( B.begin(), B.end() );
B.erase( unique( B.begin(), B.end() ), B.end() );
for(int i = 0; i < A.size(); i++)
{
    for (int j = 0; j < B.size(); j++)
    {
        if (A[i] == B[j])
        {
            int temp = A[i];
            U.push_back(temp);
            temp = B[j];
            U.push_back(temp);
        }
              //Used To Sort The Vector So There Is No Duplicates And Its In Order!
              sort( U.begin(), U.end() );
              U.erase( unique( U.begin(), U.end() ), U.end() );
    }
}
cout << "Intersection: ";
for(int z = 0; z < U.size(); z++)
{
    cout << U[z] << " ";
}
}
void Difference()
{
    int temp = 0;
    vector<int> D{};
    vector<int> A{3, 4, 9, 12, 13, 15};
    vector<int> B{1, 3, 5, 7, 9};
    for(int i = 0; i < A.size(); i++)
    {
        for (int j = 0; j < B.size(); j++)
        {
            if (A[i] == B[j])
            {
                cout << A[i];
            }
            else
            {
                int temp = A[i];
                D.push_back(temp);
            }
                  //Used To Sort The Vector So There Is No Duplicates And Its In Order!
                  sort( D.begin(), D.end() );
                  D.erase( unique( D.begin(), D.end() ), D.end() );
        }
    }
    cout << "Difference: ";
    for(int z = 0; z < D.size(); z++)
    {
        cout << D[z] << " ";
    }
}
