forked from 11.IB/logic
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Baltazár Radics 76d243e75c | 3 years ago | |
---|---|---|
.gitignore | 3 years ago | |
Program.cs | 3 years ago | |
README.md | 3 years ago | |
Template.csproj | 3 years ago |
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).