Salut les amis j'écris deux programme, l'un chargé de créer p factures et l'autre n chèques :
facture code source:
code source chèque:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 #include<stdlib.h> #include<stdio.h> struct facture{ int code; char nom[20]; int bp; char ville[20]; int tel; float montant; int index_deb; int index_fin; }; void creer_facture(int code,char nom[20],int index_deb,int index_fin,int bp,char ville[20],int tel,float montant) { printf("entrez le code\n"); scanf("%d",&code); printf("nom\n"); scanf("%s",&nom); printf("bp\n"); scanf("%d",&bp); printf("ville\n"); scanf("%s",&ville); printf("tel\n"); scanf("%d",&tel); printf("entrez l index\n"); scanf("%d",&index_deb); printf("index fin\n"); scanf("%d",&index_fin); printf("entrer montant\n"); scanf("%f",&montant); printf("la facture se presente comme suit :\n code:%d\n nom:%s\n bp:%d\n ville:%s\n tel:%d\n index debut:%d\n index fin:%d\n montant:%f\n",code,nom,bp,ville,tel,index_deb,index_fin,montant); } int main() { int codefact,indexdeb,indexfin,tel,bp; char nom,ville; float montantfact; printf("remplissez la facture\n"); creer_facture(codefact,nom,bp,ville,tel,indexdeb,indexfin,montantfact); return 0; }
chaque fois que j'exécute j'ai:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 #include<stdlib.h> #include<stdio.h> struct cheque{ int numcheque; int numcompte; float montantpaye; char nomclient[20]; int codefacture; }; void creer_cheque(int numcheque,int numcompte,float montantpaye,char nomclient[20],int codefacture) { printf("entrez le numero d cheque\n"); scanf("%d",&numcheque); printf("numero du compte\n"); scanf("%d",&numcompte); printf("montant paye\n"); scanf("%d",&montantpaye); printf("nom du client\n"); scanf("%s",&nomclient); printf("code facture\n"); scanf("%d",&codefacture); printf("le cheque se presente comme suit :\n numero du cheque:%d\n numero du compte:%d\n montant paye:%f\n nom du client:%s\n code facture:%d\n",numcheque,numcompte,montantpaye,nomclient,codefacture); } int main() { int numcheque,numcompte,codefacture; char nomclient; float montantpaye; printf("remplissez la facture\n"); creer_cheque(numcheque,numcompte,montantpaye,nomclient,codefacture); return 0; }
aidez moi svp
Partager