| | |
urgent:How to find uncommon elements in 2 arrays
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Dec 2008
Posts: 4
Reputation:
Solved Threads: 1
This shud do.
C++ Syntax (Toggle Plain Text)
#include<iostream.h> #include<conio.h> void main() { int a[10],b[10],i,j,flag=0; cout<<"\n Enter the elements of array 1"; for(i=0;i<4;i++) cin>>a[i]; cout<<"\n Enter the elements of array 2"; for(j=0;j<2;j++) cin>>b[j]; for(i=0;i<4;i++) { flag=0; for(j=0;j<2;j++) if(a[i]==b[j]) flag++; if(!flag) cout<<a[i]<< " "; } getch(); }
Last edited by mynameisor; Dec 9th, 2008 at 4:14 am.
![]() |
Other Threads in the C++ Forum
- Previous Thread: Can anyone slove this question?
- Next Thread: Conversion error passing Vector as a pointer to void function...
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





