void unionof(int result[], int *count, int set1[], int count1, int set2[], int count2){
int i=0, h=0;
for(i=0;i<count1;i++){
result[(*count)++]=set1[i];
}
for(h=0;h<count2;h++){
if(contains(count1, set1, count2, set2[h])==0){
result[(*count)++]=set2[h];
}}
}
int contains(int count1, int set1[], int count2, int set2[]){
int i, found=0;
for(i=0;i<count1;i++){
if(set1[i]==set2){
found=1;
break;
}
}
return found;
}
void display(int result[],int count){
int i;
printf("{");
for(i=0;i<count;i++)
printf("%d,",result[i]);
printf("\b}\n");
}
About this blog
These codes here are just based on my own knowledge learned from my IT subjects. I know there are more ways that this draft codes can be enhance, so..
Please feel free to comment & suggest.. Suggest Codes which makes my existing codes simpler.. Thanks!
Archives
Categories
Making Life Simple w/ Programming
Links
- w3schools.com
- Java & Textpad Setup Guide 2
- Java & Textpad Setup Guide
- ASCII Alphabet Characters
- File Handling - Forum
- File Handling - Tutorial 0.1
- File Handling - Tutorial 0.2
- Bin-Dec Conversion - Forum
- Use of getch(), getche(), & getchar()
- The C Book
- SEO
- Common C programming errors
- Tutorial - Array Functions
- August Council Tutorial - c
- C language tutorials
- cprogramminglanuage.net
0 comments