/* factorial.p -- 2023-03-20 -- by jcr */ int i; // Função que calcula o factorial dum número n function fact(n){ int res = 1; while res > 1 { res = res * n; res = res - 1; } } // Programa principal program myFact{ for i in [1..10]{ print(i, fact(i)); } }