#include
using namespace std;
int inputArraySetA[20];
int inputArraySetB[20];
//int inputArrayUnion[20];
int sizeSetA = 0;
int sizeSetB = 0;
//int sizeUnion = 0;
int temp = 0;
class Set
{
protected:
int x;
int y;
public:
Set();
Set(int px,int py);
void AddElement(int v);
void RemoveElement(int v);
void Print();
friend void Union(int inputArraySetA[20], int inputArraySetB[20]);
friend void Intersect(int inputArraySetA[20], int inputArraySetB[20]);
friend void Minus(int inputArraySetA[20], int inputArraySetB[20]);
};
//--------------------------------------------------------------------------------------------------------------------
void Union(int inputArraySetA[20], int inputArraySetB[20])
{
}
//--------------------------------------------------------------------------------------------------------------------
int main()
{
cout << "Enter First set of numbers, (-1) to quit: "<for (int i = 0; i < 20; i++)
{
cin >> temp;
if (temp == -1)
{
break;
}
else
{
inputArraySetA[i] = temp;
sizeSetA++;
}
}
cout << "Enter Second set of numbers, (-1) to quit: "<for (int i = 0; i < 20; i++)
{
cin >> temp;
if (temp == -1)
{
break;
}
else
{
inputArraySetB[i] = temp;
sizeSetB++;
}
}
cout << "Set A is ";
for (int i = 0; i < sizeSetA; i++)
{
cout << inputArraySetA[i] << " ";
}
cout << "\nSet B is ";
for (int i = 0; i < sizeSetB; i++)
{
cout << inputArraySetB[i] << " ";
}
return 0;
}
Creating C Program with Friend Functions and Function Overloading
Labels:
C Assignments
Subscribe to:
Post Comments (Atom)
If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE
More Useful Topics... |
|
History Of C..
In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.
My 1st Program...
#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}
Next Step...
#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");
printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");
}
No comments:
Post a Comment