Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
teaching
nswi098
Cecko
skeleton
Commits
f0338ce6
Commit
f0338ce6
authored
Dec 30, 2020
by
Bednárek David RNDr. Ph.D.
Browse files
missing shortcut.c file recovered
parent
b286d722
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/testcontrol-shortcut.c
0 → 100644
View file @
f0338ce6
// shortcut evaluation of &&, ||
void
f
(
_Bool
a
,
_Bool
b
,
_Bool
c
,
_Bool
d
)
{
printf
(
"((%d&&%d)||(%d&&%d)) = "
,
a
,
b
,
c
,
d
);
if
((
a
&&
b
)
||
(
c
&&
d
))
{
printf
(
"1 ; "
);
}
else
{
printf
(
"0 ; "
);
}
printf
(
"((%d||%d)&&(%d||%d)) = "
,
a
,
b
,
c
,
d
);
if
((
a
||
b
)
&&
(
c
||
d
))
{
printf
(
"1
\n
"
);
}
else
{
printf
(
"0
\n
"
);
}
}
int
main
(
int
argc
,
char
**
argv
)
{
do
{
f
(
0
,
0
,
0
,
0
);
f
(
0
,
0
,
0
,
1
);
f
(
0
,
0
,
1
,
0
);
f
(
0
,
0
,
1
,
1
);
f
(
0
,
1
,
0
,
0
);
f
(
0
,
1
,
0
,
1
);
f
(
0
,
1
,
1
,
0
);
f
(
0
,
1
,
1
,
1
);
f
(
1
,
0
,
0
,
0
);
f
(
1
,
0
,
0
,
1
);
f
(
1
,
0
,
1
,
0
);
f
(
1
,
0
,
1
,
1
);
f
(
1
,
1
,
0
,
0
);
f
(
1
,
1
,
0
,
1
);
f
(
1
,
1
,
1
,
0
);
f
(
1
,
1
,
1
,
1
);
}
while
(
--
argc
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment