[ create a new paste ] login | about

Link: http://codepad.org/6HKWQBEt    [ raw code | output | fork ]

appunti2 - Perl, pasted on Apr 29:
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl
#
# Il numero di partenza viene fornito come costante.
#
$numero = 5;
$cont = $numero -1;
while ($cont)
  {
    $numero *= $cont;
    $cont--;
  }
print "Il fattoriale è $numero.\n";


Output:
1
Il fattoriale è 120.


Create a new paste based on this one


Comments: