HP C A.06.05 Reference Manual

Expressions and Operators
Logical Operators (&&, ||, !)
Chapter 5 117
printf("Look out Paris!\n");
else if (enough_vacation &&(!money_saved))
printf("You've got the time, but you haven't got \
the dollars.\n");
else if (!enough_vacation || (!money_saved))
{
printf("Tough luck. Try saving your money and ");
printf("vacation days next year.\n");
} /* end else/if */
}
If you execute this program, you get the following output:
This program determines whether you can take your next vacation
in Europe.
Have you won the lottery? y or n: y
Do you have enough vacation days saved? y or n: n
Have you saved enough money for the trip? y or n: n
Why do you need a program to decide if you can afford a trip to
Europe?
Look out Paris!