Mathc initiation/a493

Un livre de Wikilivres.


Sommaire


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

c00d.c
/* ---------------------------------- */
/* save as c00d.c                     */
/* ---------------------------------- */
#include "x_afile.h"
#include      "fd.h"
/* ---------------------------------- */
int main(void)
{
double i;

 clrscrn();
 printf(" The Ratio Test.                                       \n\n");
 printf(" Let S.a_n be positive-term series.                    \n\n");
 printf(" lim n->oo (a_(n+1)/a_n) = c < 1      The series converge\n");
 printf(" lim n->oo (a_(n+1)/a_n) = c > 1, +oo The series diverge \n");
 printf(" lim n->oo (a_(n+1)/a_n) = c = 1      Use another test \n\n");
 stop();

 clrscrn();
 printf(" a_n   : n-> %s         \n",     a_neq);
 printf(" a_n+1 : n-> %s       \n\n", a_npls1eq);
 printf(" c_n   : n-> a_n+1/a_n\n\n");

 for(i=100; i<1000; i+=100)
     printf(" c_%.0f = %5.3f || \n", i, a_npls1(i)/a_n(i));
 
 printf(" \n\n\n"   
        " lim n->oo (a_(n+1)/a_n) = c = 1      Use another test \n\n");
 stop();

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


Exemple de sortie écran :

 The Ratio Test.                                       

 Let S.a_n be positive-term series.                    

 lim n->oo (a_(n+1)/a_n) = c < 1      The series converge
 lim n->oo (a_(n+1)/a_n) = c > 1, +oo The series diverge 
 lim n->oo (a_(n+1)/a_n) = c = 1      Use another test 

 Press return to continue.


Exemple de sortie écran :

 a_n   : n-> 1/(3*n+2)         
 a_n+1 : n-> 1/(3*(n+1)+2))       

 c_n   : n-> a_n+1/a_n

 c_100 = 0.990 || 
 c_200 = 0.995 || 
 c_300 = 0.997 || 
 c_400 = 0.998 || 
 c_500 = 0.998 || 
 c_600 = 0.998 || 
 c_700 = 0.999 || 
 c_800 = 0.999 || 
 c_900 = 0.999 || 
 


 lim n->oo (a_(n+1)/a_n) = c = 1      Use another test 

 Press return to continue.