The document contains pseudocode to take 3 numbers from the user as input, add them together, and output their sum. It defines a procedure called EnterANumber to input each number, a function called SumOf3Numbers to calculate and return the sum, and a main module called Assignment1 that calls the function to get the sum and output it.
The document contains pseudocode to take 3 numbers from the user as input, add them together, and output their sum. It defines a procedure called EnterANumber to input each number, a function called SumOf3Numbers to calculate and return the sum, and a main module called Assignment1 that calls the function to get the sum and output it.
The document contains pseudocode to take 3 numbers from the user as input, add them together, and output their sum. It defines a procedure called EnterANumber to input each number, a function called SumOf3Numbers to calculate and return the sum, and a main module called Assignment1 that calls the function to get the sum and output it.
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