Mathc initiation/Fichiers c : c04f

Un livre de Wikilivres.

Sommaire


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

c04f.c
/* ------------------------------ */
/*  Save as :   c04f.c            */
/* ------------------------------ */
#include      "x_a.h"
/* ------------------------------ */
int main(void)
{
double a=1;

 clrscrn();

 printf(" (a-=0.1)  \n\n");

 while( (a-=0.1) > 0 )
                 
        printf(" a = %6.3f\n", a); 

 stop();

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


Attention les parenthèses sont obligatoires.


Exemple de sortie écran :

 (a-=0.1)  

 a =  0.900
 a =  0.800
 a =  0.700
 a =  0.600
 a =  0.500
 a =  0.400
 a =  0.300
 a =  0.200
 a =  0.100
 a =  0.000

 Press return to continue.