forked from 11.IB/logic
|
||
---|---|---|
.gitignore | ||
Program.cs | ||
README.md | ||
Template.csproj |
README.md
Logic operations, branching
- Declare three Boolean variables:
a
,b
andc
. Assign the logic valuestrue
,true
andfalse
, respectively. Displaya AND b
,a OR b
,a AND c
,a OR (b AND c)
,(a OR b) AND c
,c XOR b
,a XOR b
. Use the format"a XOR c = TRUE"
. Check your results with truth tables. - Let the Boolean variable a be
TRUE
. Ask the user to type in a0
or1
and let the Boolean variableb
have valuesFALSE
orTRUE
based on the input. Displaya AND b
,a OR b
,a XOR b
in the format used in exercise 1. - Ask for a number from the user. Write whether the number is divisible by
2
,3
and4
(you may make use of the property of divisions that they may have different results when using integers or doubles, but other methods are allowed as well).