Consider the following program:
procedure Main is
A, B, C : Integer
procedure Sub1 is
D, E, F : Integer;
begin -- of Sub1
...
end -- of Sub1
procedure Sub2 is
G, H, I : Integer
procedure Sub3 is
J, K, L : Integer;
begin -- of Sub3
...
end -- of Sub3
begin -- of Sub2
...
end; --- of sub2
begin -- of Main
...
end; --- of Main
List all the variables, along with the program units where they are declared, that are visible in the bodies of Sub1, Sub2, and Sub3, assuming static scoping is used.
Rewrite the following code segment using a multiple-selection statement in the C programming language
if ( (k == 1) || (k == 2)) j = 2 * k - 1;
if ( (k == 3) || (k == 5)) j = 3 * k + 1;
if ( k == 4 ) j = 4 * k - 1;
if ( (k == 6) || (k == 7) || (k == 8)) j = k - 2;