Throw a couple of values at the expression like 'R', 'S', and 'T'. Mentally do the comparisons and get your result. Or write a little bit of code to help.
Code:
#include <stdio.h>
void foo(char reqOrSugg)
{
printf("'%c' != 'R' && '%c' != 'S' => ", reqOrSugg, reqOrSugg);
printf("%d && %d = %d\n", reqOrSugg != 'R', reqOrSugg != 'S',
reqOrSugg != 'R' && reqOrSugg != 'S');
}
void bar(char reqOrSugg)
{
printf("'%c' != 'R' || '%c' != 'S' => ", reqOrSugg, reqOrSugg);
printf("%d || %d = %d\n", reqOrSugg != 'R', reqOrSugg != 'S',
reqOrSugg != 'R' || reqOrSugg != 'S');
}
int main (void)
{
foo('R');
foo('S');
foo('T');
bar('R');
bar('S');
bar('T');
return 0;
}
/* my output
'R' != 'R' && 'R' != 'S' => 0 && 1 = 0
'S' != 'R' && 'S' != 'S' => 1 && 0 = 0
'T' != 'R' && 'T' != 'S' => 1 && 1 = 1
'R' != 'R' || 'R' != 'S' => 0 || 1 = 1
'S' != 'R' || 'S' != 'S' => 1 || 0 = 1
'T' != 'R' || 'T' != 'S' => 1 || 1 = 1
*/