b. Write an algorithm to determine the average of any six (5) numbers and display the below after: The sum, the product and the average.
c. Describe what is a variable and how is it used in a program.
b. The pseudocode is below:
a=input(First number)
b=input(Second number)
c=input(Third number)
d=input(Fourth number)
e=input(Fifth number)
f=input(Sixth number)
Sum=a+b+c+d+e+f
Prd=a*b*c*d*e*f
Avg=Sum/6
Print(Sum)
Print(Prd)
Print(Avg)
c. The variable is a quantity that may take any value defined by the user or program code. It is used in programs to store values and perform operations with these values.
Comments
Leave a comment