You are on page 1of 2

PROCEDURE EnterANumber

Psuedocode FOR index  1 TO 3


Q. Take 3 numbers from the user and output there sum INPUT “ Enter a Number” num[index]
INPUT “ Enter a Number” num1 ENDFOR
INPUT “ Enter a Number” num2 ENDPROCEDURE
INPUT “ Enter a Number” num3
Sum  num1 + num2 + num3 FUNCTION SumOf3Numbers
OUTPUT Sum CALL EnterANumber
_____________________________________________ Sum  num[1] + num[2] + num[3]
INPUT “ Enter a Number” num[1] RETURN Sum
INPUT “ Enter a Number” num[2] ENDFUNCTION
INPUT “ Enter a Number” num[3]
Sum  num[1] + num[2] + num[3] MODULE Assignment1
OUTPUT Sum Sum SumOf3Number
_____________________________________________ OUTPUT Sum
ENDMODULE
FOR index  1 TO 3
INPUT “ Enter a Number” num[index]
ENDFOR
Sum  num[1] + num[2] + num[3]
OUTPUT Sum

You might also like