/*
* TP1 : initiation au langage C
*
* Exercice 4 - 24/09/02
*
* ©2002 All Rights Reserved to www.Software-DS.com
*/
#include <stdio.h>
#define n 7
/* Declaration du prototype */
int f(int x,int i);
int main(void)
{
printf("\nhttp://www.Software-DS.com\n\n");
printf("La valeur de x est: %d\n",f(1,1));
return 0;
/* ©2002 All Rights Reserved to http://www.Software-DS.com
*/
}
int f(int x,int i)
{
printf(" x=%3d i=%3d\n",x,i); /* facultatif pour
afficher les etapes intermediares */
if (i<n)
return f(x*i,i+1);
else
return x;
/* ©2002 All Rights Reserved to http://www.Software-DS.com
*/
}
|