Define entre_2_dates()= Prgm :Local j1,m1,a1,j2,m2,a2 :Local b,c,d,e,h,bx1,bx2,n :Local jj1,jj2,jr1,jr2,mo1,mo2,an1,an2 :0→j1:0→m1:0→a1:0→j2:0→m2:0→a2 :0→b:0→c:0→d:0→e:0→h:0→bx1:0→bx2 :0→jr1:0→jr2:0→mo1:0→mo2:0→an1:0→an2 :28→n1:28→n2:0→njr :setMode(5,2) :©---------------------explique :For i,1,2:Disp "":EndFor :Disp "calcul du nombre de jour" :Disp "entre deux dates" :Disp "donner les dates en chiffres" :Disp "[enter] pour commencer" :For i,1,2:Disp "":EndFor :getKey(1) :©------------demandes à l'utilisateur :Request "jour date 1: ",j1 :Request "mois date 1: ",m1 :Request "année date 1: ",a1 :Request "jour date 2: ",j2 :Request "mois date 2: ",m2 :Request "année date 2: ",a2 :©-------------------sauvegarde :j1→jr1:m1→mo1:a1→an1 :j2→jr2:m2→mo2:a2→an2 :©----------voir si bissextile pour teste :If mod(a1,4)=0 and mod(a1,100)≠0 or mod(a1,400)=0 : 1→bx1 :If mod(a2,4)=0 and mod(a2,100)≠0 or mod(a2,400)=0 : 1→bx2 :©------------------ teste des dates :If j1<1 or j2<1:Goto err :If m1<1 or m2<1:Goto err :If a1<−4712 or a1=0 or a1>9999:Goto err :If a2<−4712 or a2=0 or a2>9999:Goto err :If j1>30 or j2>30 Then : If m1=4 or m1=6 or m1=9 or m1=11:Goto err : If m2=4 or m2=6 or m2=9 or m2=11:Goto err :EndIf :If j1>31 or j2>31 Then : If m1=1 or m1=3 or m1=5 or m1=7 or m1=8 or m1=10 or m1=12:Goto err : If m2=1 or m2=3 or m2=5 or m2=7 or m2=8 or m2=10 or mo=12:Goto err :EndIf :If m1=2 and j1>n1+bx1:Goto err :If m2=2 and j2>n2+bx2:Goto err :©---------------------------jj1 :If m1<3 Then : a1-1→a1:m1+12→m1 :EndIf :int(((a1)/(100)))→b :2-b+int(((b)/(4)))→c :int(365.25*a1)→d :int(30.6001*(m1+1))→e :c+d+e+j1+t→jj1 :©---------------------------jj2 :If m2<3 Then : a-1→a2:m2+12→m2 :EndIf :int(((a2)/(100)))→b :2-b+int(((b)/(4)))→c :int(365.25*a2)→d :int(30.6001*(m2+1))→e :c+d+e+j2+t→jj2 :©-------------------------calcul :If jj1>jj2 Then : jj1-jj2→njr :Else : jj2-jj1→njr :EndIf :© njr+1→njr (pour compter le jour 1) :©------------------------ affiche :For i,1,2:Disp "":EndFor :Disp "entre le: ",jr1,"/",mo1,"/",an1 :Disp "et le: ",jr2,"/",mo2,"/",an2 :Disp "" :Disp "le nombre de jour est: ",njr :For i,1,3:Disp "":EndFor :getKey(1) :Goto fin :©------------------------- erreur :Lbl err :For i,1,2:Disp "":EndFor :Disp " Désolé date non valide" :For i,1,2:Disp "":EndFor :getKey(1) :©--------------------------- fin :Lbl fin :EndPrgm