what is a compound statement or block? Give an example.
Answers
Answered by
0
Answer:
Answered by
13
A compound statement is said to be ill-formed if it is ambiguous as to how its substatements are grouped by the action of the connectives. For example, in natural language: I would like some juice or water with ice.
A compound statement (also called a block, or block statement) is a group of zero or more statements that is treated by the compiler as if it were a single statement. ... Blocks can be used anywhere a single statement is allowed.Consider statements p:=1+1=2 and q:=2<5. Note that, p∧q is true only if both p and q are both true. Since statements p and q are both true, p∧q is true.
Similar questions