
Jennifer H. answered 04/04/20
Experienced teacher/tutor, software developer with Physics PhD
An XNOR gate's truth table is the opposite of XOR:
A B XNOR
F F T
F T F
T F F
T T T
Looking at the table, you can see that it is true if the two inputs are the same, and false if the two inputs are different.
So assuming that your inputs are known to be just Boolean true/false or 0/1 values, I think the easiest representation in C would be to use the == operator:
if (val1 == val2) {
BLOCK
}