Array problem give me some clue

Level of prog 2 in turbo c

hello, good day everyone here's some problem.
my friend give this and i can't solve it. :(

sample output:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Enter Set A:{1,4,2,3}//there should be no duplicated element
Enter Set B:{4,5,6,3}
=====================================
Do you want to sort your element[Y/N]? y
[a.]=Ascending
[b.]=Desending
Enter choice: a

Set A:{1,2,3,4}
Set B:{3,4,5,6}
Sorting successfully done.

Set Operations

Union of Set A and B :{1,2,3,4,5,6}
Intersection of Set A and B :{3,4}
Diff of A to B :{1,2}
Diff of B to A : {6,5}
Symmetric Diff of A and B :{1,2,5,6}


dont use printf/scanf

can u help me in coding?
he give me some guide:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
#include <cstring.h>
int setA[10],setB[10];
int length;

void sorting()
{
	 //Write your codes here
}
//Getting the length of the input of the user
void GetInputLength(int x)
{
	//This will be use to write comma(,) after an input even more than 1-digit input;
	//use length as the increment of the column value
	char temp[10];
	itoa(x,temp,10);//x is the user's input
	length=strlen(temp);
}
//Inputting Set Elements
void inputSet(int set[],int row)
{
	//Write your codes here (You can use set as an alias name of the array being passed)
}

void GetUnion()
{
	//Write your codes here
}

void GetIntersection()
{
	//Write your codes here
}

void GetAminusB()
{
	//Write your codes here
}

void GetBminusA()
{
	//Write your codes here
}

void GetSymmetric()
{
	//Write your codes here
}
void main()
{
	char ch;
	cout<<"Enter Set A: {";
	inputSet(setA,1);
	cout<<"Enter Set B: {";
	inputSet(setB,2);
	cout<<"Do you want to sort array elements[Y/N]: ";cin>>ch;
	if(ch=='y'||ch=='Y')
	{
		sorting();
		cout<<"Sorting Successfully done...";
	}
	else
		cout<<"Sorting is being cancelled";

	GetUnion();
	GetIntersection();
	GetAminusB();
	GetBminusA();
	GetSymmetric();
}

thanks...
Last edited on
Topic archived. No new replies allowed.