Aller au contenu

Mathc initiation/a172

Un livre de Wikilivres.


Sommaire


Installer et compiler ces fichiers dans votre répertoire de travail.

c0a2.c
/* ---------------------------------- */
/* save as c0a2.c                     */
/* ---------------------------------- */
#include "x_afile.h"
#include      "fa.h"
/* ---------------------------------- */
int main(void)
{
tvalue n;

  n.min   =  1; 
  n.max   =  9;  
  
double i;


 clrscrn();
 printf(" Compute the %.0f first term of the sequence [a_n]  \n\n\n"
        " a_n : a_1      r**(n-1) \n       %.2f  %.2f**(n-1) \n\n",
          n.max, A_1, R);

 for(i=n.min; i<=n.max; i++)
 
     printf(" a_%.0f = %+7.2f \n", i, a_n(i));

 printf("\n\n");          
 stop();

 return 0;
}
/* ---------------------------------- */
/* ---------------------------------- */


Exemple de sortie écran :

 Compute the 9 first term of the sequence [a_n]  


 a_n : a_1      r**(n-1) 
       3.00  2.00**(n-1) 

 a_1 =   +3.00 
 a_2 =   +6.00 
 a_3 =  +12.00 
 a_4 =  +24.00 
 a_5 =  +48.00 
 a_6 =  +96.00 
 a_7 = +192.00 
 a_8 = +384.00 
 a_9 = +768.00 


 Press return to continue.