Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  calcolo del fattoriale
Language: C/C++
Code:
//calcolo del fattoriale
#include <stdio.h>

int x,prod;
int fact=1;

main()
{printf("inserire un valore intero positivo\\n");
scanf("%d",&x);
prod=x;
while(prod>0)
{fact=fact*prod;
prod=prod-1;}
printf("il fattoriale di %d e' %d\\n",x,fact);
getchar();
getchar();}
Comments: