In reply to dave_59:
Thanks Dave,
I got the results.
I quote the code here with comments
//Constraining values from 1 to7
constraint value {a>0; a<8;
b>0; b<8;
c>0; c<8;
d>0; d<8;
e>0; e<8;
f>0; f<8;
g>0; g<8;
}
//No one shares same floor
constraint uinque_value { unique {a,b,c,d,e,f,g};}
//E does not live on an even numbered floor
constraint E { e%2 !=0;}
//G does not live on the top most floor
constraint G { g != 7;}
//Only one person lives between E and G
constraint E_G { e-g == 2 || g-e == 2;}
//A does not live on even numbered floor and does not live below F
constraint A { a%2 !=0; a > f; }
//D does not live immediately above or immediately below G
constraint D_G { d-g != 1 || g-d != 1;}
// There two floors between D and E
constraint D_E { e-d == 3 || d-e == 3;}
// Both B and C live on even-numbered floor.
constraint B { b%2 == 0;}
constraint C { c%2 ==0;}
// F lives on floor number 5
constraint F { f == 5;}
//G and C live in between the two floors.
constraint G_C { g-c == 1 || c-g == 1;}
I still don’t get the statement “G and C live in between the two floors”
P.S. That was mentioned in the problem statement.
Apart from that everything is working perfectly