### Determine if relations are reflexive

Hello all, I am working on a program that will look at a relation and determine if it is reflexive. So far I am able to go through the pairs and determine if they are equal. I cannot figure out a way for the program to determine if the relation is reflexive. I would assume if for a number it does not find a pair then the function should return false. I cannot figure out how to code for this. Any tips would be greatly appreciated. ar1 is the first numbers in each pair and ar2 is the seconds numbers. The relation I am testing now is reflexive, but it return false for some reason.

 ``12345678910111213141516171819202122232425262728293031323334353637383940414243`` ``````#include using namespace std; bool isreflexive(int ar[],int n,int ar2[],int nn) { int j,i = 0; bool hold = true; cout<<"n " <
I think it returns false because you did not specify any return statement at all. So function returns some mysterious value.
That is what I' m having trouble figuring out where to put the return false if the relation is not reflexive and true if it is.
Topic archived. No new replies allowed.