Can we compare two array values, ex: a[1]==b[5] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can we compare two array values, ex: a[1]==b[5]

16th Sep 2016, 5:54 PM
prasanth pra
prasanth pra - avatar
5 Answers
+ 5
Yes.. Absolutely right..
16th Sep 2016, 5:56 PM
Geek
Geek - avatar
+ 2
If they the same datatype, of Course.
17th Sep 2016, 12:41 AM
LeParadoxHD | YouTube
LeParadoxHD | YouTube - avatar
+ 1
#include <iostream> using namespace std; int main() { string arr[]={"a"}; int ar[]={1}; /* wright here string ar[]={"a"}; u will see error soo u cant compare different data types variables */ if(arr[0]!=ar[0]){ cout<<"hey" ; } return 0; }
26th Sep 2016, 5:43 PM
Elay
0
any program
16th Sep 2016, 7:55 PM
Raju Kumar
Raju Kumar - avatar
0
yep you can do anything with an array which you can do with two different variable
19th Sep 2016, 7:16 AM
Divyanshu Gupta
Divyanshu Gupta - avatar