C++ coding

int x = 6;
int y = 10;
bool is_small = false;
char reply ='y';
double temp = 35.0;
What do the following boolean expressions evaluate to ?

!is_small || reply != 'n'
Is the answer true or false??
If you don't know - or can't work it out then try it with a compiler!

|| is logical or, so the expression is true if either LHS or RHS is true. reply is 'y' which is not 'n', so the RHS is true hence the expression is true.

is_small is false, so !is_small is true so the LHS is true as well.
Last edited on
Thank you!!!
Topic archived. No new replies allowed.