Solutions

Checking Two Array Members Are Equal Or Not | C++

Source Code

#include<iostream>
using namespace std;
int main()
{       int array1[5], array2[5];     
       int members1, members2;
       cout << “Enter numbers in first Array” << endl;
       for(members1 = 0; members1 < 5; members1 ++)
       {
              cin >> array1[members1];
       }
       cout << “Enter numbers in second Array” << endl;
       for(int loop = 0; loop < 5; loop ++)
       {
              cin >> array2[loop];
       }
       for(members2 = 0; members2 < 5; members2 ++)
       {
              while(array1[members2] == array2[members2])
              {    
                           cout << “First array equla to second array” << endl;
                           return 0;
              }
              if(array1[members2] != array2[members2])
                     {
                           cout << “First Arrays is not equal to second second array” << endl;
                           return 0;
                     }
       }
return 0;
}

OutPut

Two Array Members Are Equal Or Not

Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.
Yes
No

About the author

Syed Moin Ali

Hello My Name is Syed Moin Ali and I am the founder of PC Learnings Here on this blog I write about Blogging, SEO, Internet Tricks, Social Networking Site, and Make Money

/* ]]> */