Posted by MindBreaker at 8:47 AM
Read our previous post
Object
1-
Compare
two array without using strcmp()
Source code
#include <iostream>
using namespace std;
void
main()
{
int
a=0,str=0,str1,num=5;
char
array1[]="king";
char
array2[]="joker";
for(str=0;str<25;str++)
{
if(array1[str]==array2[str])
{
cout<<"Arrays are equal"<<endl;
break;
}
else
{
cout<<"Arrays are not equal"<<endl;
break;
}
}
cout<<"\n";
}
Output
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.