IBM Programming with IBM Enterprise PL/I (000-041) Free Practice Test
Question 1
CORRECT TEXT
What is the value of X after executing the following code?
DCLX SIT(1 6) INIT('l U'S);
What is the value of X after executing the following code?
DCLX SIT(1 6) INIT('l U'S);
Correct Answer: C
Question 2
CORRECT TEXT
Which of the following is a restriction using the BYVALUE attribute?
Which of the following is a restriction using the BYVALUE attribute?
Correct Answer: D
Question 3
CORRECT TEXT
What happens after the following code is executed?
DCL A CHAR(5) lNlT('ABCDE'); DCL B CHAR(4) DEF A POS(2);
What happens after the following code is executed?
DCL A CHAR(5) lNlT('ABCDE'); DCL B CHAR(4) DEF A POS(2);
Correct Answer: D
Question 4
CORRECT TEXT
What is the value of B after executing the following code?
DCLA CHAR(1) INIT(' ');
DCL B BIT(8) BASE D(ADDR(A));
DCL (HIGH, ADDR) BUILTIN;
A = HIGH(1);
What is the value of B after executing the following code?
DCLA CHAR(1) INIT(' ');
DCL B BIT(8) BASE D(ADDR(A));
DCL (HIGH, ADDR) BUILTIN;
A = HIGH(1);
Correct Answer: D
Question 5
CORRECT TEXT
Which of the following will be achieved when making a program FETCHABLE?
Which of the following will be achieved when making a program FETCHABLE?
Correct Answer: D
Question 6
CORRECT TEXT
What value is output by the following program?
TEST: PACKAGE;
D
CL N EXT FIXED BIN(31) INIT(10);
DCLC(N) EXT CONTROLLED FIXED BIN(31);
MAIN: PROC OPTIONS(MAIN);
ALLOC C;
ALLOC C(20);
N = 30;
CALL UPGM;
END;
UPGM: PROC;
ALLOC C;
N = 40;
PUT SKIP LIST( DIM(C));
END;
END;
What value is output by the following program?
TEST: PACKAGE;
D
CL N EXT FIXED BIN(31) INIT(10);
DCLC(N) EXT CONTROLLED FIXED BIN(31);
MAIN: PROC OPTIONS(MAIN);
ALLOC C;
ALLOC C(20);
N = 30;
CALL UPGM;
END;
UPGM: PROC;
ALLOC C;
N = 40;
PUT SKIP LIST( DIM(C));
END;
END;
Correct Answer: A
Question 7
CORRECT TEXT
What will be the output of the following program?
MAIN: PROC OPTIONS(MAIN);
DCL A CONTROLLED FIXED BIN(31);
DCL B CONTROLLED FIXED B IN(31);
DCL JX FIXED BIN(31);
DO JX= 1 TO 4;
ALLOC A;
A = JX;
END;
DO WHILE( ALLOCN(A)> 0);
ALLOC B;
B = A;
FREE A; END;
DO WHILE( ALLOCN(B) > 0);
PUT SKIP LIST( B);
FREE B;
END;
END;
What will be the output of the following program?
MAIN: PROC OPTIONS(MAIN);
DCL A CONTROLLED FIXED BIN(31);
DCL B CONTROLLED FIXED B IN(31);
DCL JX FIXED BIN(31);
DO JX= 1 TO 4;
ALLOC A;
A = JX;
END;
DO WHILE( ALLOCN(A)> 0);
ALLOC B;
B = A;
FREE A; END;
DO WHILE( ALLOCN(B) > 0);
PUT SKIP LIST( B);
FREE B;
END;
END;
Correct Answer: B
Question 8
CORRECT TEXT
Given the following code, how many times is the loop executed?
DCL NEGATIVE BIT (1) INIT ('0'B);
DCLIFIXED BIN (31) INIT (10);
DO WHILE (^NEGATIVE)
PUT (I);
I += 1;
IF I >= 0 THEN NEGATIVE = '0'B;
ELSE
NEGATIVE = '1'B;
END;
Given the following code, how many times is the loop executed?
DCL NEGATIVE BIT (1) INIT ('0'B);
DCLIFIXED BIN (31) INIT (10);
DO WHILE (^NEGATIVE)
PUT (I);
I += 1;
IF I >= 0 THEN NEGATIVE = '0'B;
ELSE
NEGATIVE = '1'B;
END;
Correct Answer: B
Question 9
CORRECT TEXT
Given the following code, how many elements of A will contain a value of 0 after execution of the
loops?
DOL A DIM (8, 10) FIXED BIN (31);
DCL(I, K) FIXED BIN (31) INIT (0);
A = 0;
DO I = 2 TO 8;
DO K = 1 TO 10;
A(I, K) = l*K;
END;
END;
Given the following code, how many elements of A will contain a value of 0 after execution of the
loops?
DOL A DIM (8, 10) FIXED BIN (31);
DCL(I, K) FIXED BIN (31) INIT (0);
A = 0;
DO I = 2 TO 8;
DO K = 1 TO 10;
A(I, K) = l*K;
END;
END;
Correct Answer: D