Math and Arithmetic
C Programming
Algebra

Programme to write positive numbers until the user enters no and then sum the numbers divisible by 4 that lie between the range of 10 and 50 and finally display the count and the average value?

123

Answer

User Avatar
Wiki User
04/29/2010

ALGORITHM SAMPLE

i = 0

REPEAT

OUTPUT ("Enter a number: ")

INPUT (number[i])

i ++

UNTIL (number[i] 0) THEN

counter++

sum = sum + number[i]

END IF

END FOR

DISPLAY (counter)

DISPLAY (sum / counter)

END SAMPLE