Mathc initiation/Fichiers c : do2b
Installer et compiler ce fichier dans votre répertoire de travail.
c00a.c |
---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
int main(void)
{
nb_Z a;
do{
clrscrn();
a = i_Z( 1, -3);
printf(" a = "); p_Z(a,S3,P0,S3,P0); printf("\n\n");
printf(" Re(a) = %+8.3f \n",Re_Z(a));
printf(" Im(a) = %+8.3f \n\n\n",Im_Z(a));
a = r_Z(9999);
printf(" a = "); p_Z(a,S6,P1,S1,P1); printf("\n\n");
printf(" Re(a) = %+8.1f \n",Re_Z(a));
printf(" Im(a) = %+8.1f \n\n\n",Im_Z(a));
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Nous allons cette fois imprimer les parties réelles et imaginaires des nombres complexes.
Exemple de sortie écran :
a = +1 -3i
Re(a) = +1.000
Im(a) = -3.000
a = +9830.0-964.0i
Re(a) = +9830.0
Im(a) = -964.0
Press return to continue
Press X return to stop