UNION OF TWO SETS IN C++ || FULL EXPLAINED || PROGRAMMING MENTOR

UNION OF TWO SETS IN C++ || FULL EXPLAINED || PROGRAMMING MENTOR


assalam u alaikum today we will create a new program n the series of c++ simple program series that will be able to find the union of the two sets in c++ so lets begin first of all i am using visual studio 2017 i crate a new file or project file new project in project file you should select consle application this is the workplace where should have to code it has already test program named hello world first of all select the all code and remove it this is to long and take a time of mine lets create our plan now these two header files are the default header file for the visual studio this one pch is called pre compiled header file this is what all of us know now we have to create main function the c++ program starts from the main function we have two sets A and B and the union set will be the set contain the elements of both the sets we have to create the array for the elements of the sets we have to declare the size of the array is well we have to write using namespace std; i declade size1 and size two the variable for the size of the array the user have to enter the size of the both set it means that the user have to tell the program that how much elemets are ther in the sets it is very easy i have to declare the size1 and the size2 now we have the size of the both sets now we have to take the elements of the sets from the user to find the union of the sets we have to take these elements in the array for loop now we have to take the elements of set2 now we have the two sets now i an going to create the logic for the claculating union union of sets in c++ set operation union set 1 this is just a prompt to the screen that the union of the set is i just want to display all the elements of set 1 is we know that the union sets contain all the elements of the first set i display all the elements of the set1 in for loop set1 ND size 1 now we have to display those elements of set2 which is not present in set1 think about the logic it is easy this is the end of the program program is working sets union find in c++ subscribe please

2 thoughts on “UNION OF TWO SETS IN C++ || FULL EXPLAINED || PROGRAMMING MENTOR”

Leave a Reply

Your email address will not be published. Required fields are marked *