Determine the exact output that is produced when the following code is executed.
for x = 1 to 10 step 1
for y = 1 to x step 1
if y MOD 2 = 0 AND x MOD 2 <> 0 || y MOD 2 <> 0 AND x MOD 2 = 0 then
display "*"
else
display "#"
endif
next y
display " " ~newline
next x
The programm will output:
#
#
#
#
#
#
#
#
#
#
Comments
Leave a comment