Mathc complexes/a125

Un livre de Wikilivres.

Application

Installer et compiler ce fichier dans votre répertoire de travail.

test01f.c
/* ------------------------------------ */
/*  Save as :   test01f.c               */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------	*/
int main(void)
{
int n = 0;

  	clrscrn(); 
  	
	do{
		if(!n) 
		   
		   printf("   %d! = %d\n", n, factorial(n));
		   
		else
		
           printf(" %3.d! = %d\n", n, factorial(n));

    }while(n++ < 10);

    printf("\n\n"); 
       
    stop();
		
  return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */


Calculer n! 


Exemple de sortie écran :

   0! = 1
   1! = 1
   2! = 2
   3! = 6
   4! = 24
   5! = 120
   6! = 720
   7! = 5040
   8! = 40320
   9! = 362880
  10! = 3628800


 Press return to continue.