Page 1010 - IT2
P. 1010

Fin

               d)  Regrouper les trois sous algorithmes précédents dans un algorithme principal.









            Partie pratique :

            DOSSIER I– LANGAGE DE  PROGRAMMATION STRUCTUREE

            #include<stdio.h>
            #include<stdlib.h>
            #include<string.h>
            //1- création de la structure patient et de la structure date

            typedef struct date{
                                                  int jour ;
                                                 int mois;
                int annee;
            }date;


             typedef struct patient{
                                               char nom[50];
                                                char cin[8];
                                            char telephone[10];
                                 char genre;//H pour Homme et F pour Femme
                                                 float age;
                                              date dernconsul;
            }patient;


            //3- procédure ajout d'un nouvel abonne
            void ajoutPatient()
            {
                 // ouverture du fichier en mode ajout
             FILE*  fichier = fopen("patients.dat", "a");
                // Récupération d'un abonné au prés de l'utilisateur
                 Patient p;

              printf("donner le nom du patient");
              scanf("%s",&p.nom);

                  Filière                    Epreuve                       Session              4/12
                  TDM                  Synthèse V2(Correction)            Juillet 2014
                                          www.itlearning-settat.com

                                   Email: admission@itlearning-settat.com
                                                   Tél.:0661077812
   1005   1006   1007   1008   1009   1010   1011   1012   1013   1014   1015