Computer Science, asked by sahrambahadur08, 4 days ago


Write the output of the following program:
DECLARE SUB REMINDER (R)
CLS
FOR I = 1 TO 4
READ X
CALL REMINDER (X)
NEXTI
DATA 56, 28, 8, 48
END
SUB REMINDER (R)
R1 =R MOD 4
R2 = R MOD 3
IF R1 = 0 AND R2<> 0 THEN
PRINT R
END IF

END SUB

Answers

Answered by hanwatdevesh
0

Dry Run:

X R R1=R MOD 4 R2=R MOD 3 R1=0 AND R2<>0 PRINT R

56 56 R1 = 0 R2=2 YES 56

28 28 R1=0 R2=1 YES 28

8 8 R1=0 R2=2 YES 8

48 48 R1=0 R2=0 NO -

∴Final output is:

56

28

8

Similar questions