Professional Documents
Culture Documents
Write An Algorithm That Computes For The Average of Three Scores
Write An Algorithm That Computes For The Average of Three Scores
Start
Sum = n1 + n2 + n3
Average = Sum ÷ 3
Print Average
End
2. Write an algorithm that accepts time in seconds then display in hour/s, minute/s,
second/s equivalent.
Start
End
3. Accept three numbers and display in ascending order.
Start
enter 1, 2, 3
1>2
2>3 2>3
Print Print
1, 2, 3 2, 1, 3
1>3 2>3
End
4. Write an algorithm to check whether a number is prime or not.
Start
Flag = 1, I = 2
Read n
If flag = 0
I=I+1
Print prime
If n/I = 1 num
Start
Is num1 = num 2
Is num1 >
num2
n1 = n1 – n2 n1 = n1 – n2
Print n1
End