Union of Sets :- If two sets A and B are given, then the union of A and B is equal to the set that contain all the elements, present in set A and set B. This operation can be represented as;
Example: If set A = {1,2,3,4} and B {6,7} Then, Union of sets, A ∪ B = {1,2,3,4,6,7}

 #include 
 int main()
 {
    int a[10], b[10], c[10], i, j, k = 0, n1, n2;
   
    // Creating first set, Set A
    printf("Enter the size of set A\n");
    scanf("%d", &n1);
    printf("Enter the elements of set A\n");
    for (i = 0; i < n1; i++)
    {
        scanf("%d", &a[i]);
    }
    // Creating second set, Set B
    printf("Enter the size of set B\n");
    scanf("%d", &n2);
    printf("Enter the elements of set B\n");
    for (i = 0; i < n2; i++)
    {
        scanf("%d", &b[i]);
    }
    // printing set A
    printf("\n set A is :-\n");
    for(i=0; i

When the above program is executed, it produces the following result −