1)
citeste n
fac=1
daca n=0 atunci
scrie 1
altfel
pentru i=1, n executa
fact=fact*i
scrie fact
exemplu: n=5 => i=1, fact=1; i=2, fact=2; i=3, fact=6; i=4, fact=24; i=5, fact=120
2)
citeste n
copie=n
cat timp copie>=1 executa
citeste nr
suma=suma+nr
contor=contor+1
copie=copie-1
scrie suma/contor
exemplu: n=3 => copie=3, nr=2, suma=2, contor=1; copie=2, nr=4, suma=6, contor=2; copie=1, nr=8, suma=14, contor=3, copie=0 => stop => 14/3=4,66