In: Computer Science
ANSWER :
INPUT /Input Variable a
STORE a /Store variable a
OUTPUT /Display Variable a
INPUT /Input Variable b
STORE b /Store variable b
OUTPUT /Display Variable b
INPUT /Input Variable c
STORE c /Store variable c
OUTPUT /Display Variable c
/ Loop for performing iterative addition and giving
res=a*b
loop1, LOAD res
ADD a
STORE res
Load b
SUBT one
STORE b
SKIPCOND 400 /Is multiplication is completed?
JUMP loop1 /if No,then repeat loop1 Again and if Yes,Exit the
loop1
/ Again,Loop for performing iterative addition and
giving z=res*c=a*b*c
loop2, LOAD z
ADD res
STORE z
LOAD c
SUBT one
STORE c
SKIPCOND 400 /Is multiplication is completed?
JUMP loop2 /if No,then repeat loop2 Again and if Yes,Exit the
loop2
LOAD z /Load the final result to varable z
OUTPUT /Print final Answer i.e.Variable z=a*b*c
HALT /Stop the program
/Declaring variables used in program
a, DEC 0
b, DEC 0
c, DEC 0
z, DEC 0
one, DEC 1
res, DEC 0
END