Question 4 :-
A-
while (k <= 10)
if (j > 5)
k = k + 2;
else
k = 20;
B-
Show 2 different ways to write the following sentence in the QUAD language.
First option: the check whether to execute a certain case is adjacent to the code that must be executed if the
case corresponds to an expression on which a switch is made.
Second option: the tests which case to perform appear in sequence one after the other.
(When the appropriate case is found, jump to its code).
The code sections to be executed for the different cases also appear consecutively.
switch (y + 7) {
case 11: z = 100; // no break here
case 22: z = 200; break
default: z = 300;
}
It is assumed that all variables are of type int
Note that in the absence of break, we do through fall, which means we continue
and execute the code of the following case (as in the C language)