mardi 27 septembre 2016
    1. Program Calculette;
    2. Var a, b : Real;
    3. op : Char;
    4. Begin
    5. Readln (a) ;
    6. Readln (op) ;
    7. Readln (b) ;
    8. Case op of
    9. '+' : Writeln (a:3:2,' ',op,' ',b:3:2,' = ',a+b:3:2 ) ;
    10. '-' : Writeln (a:3:2,' ',op,' ',b:3:2,' = ',a-b:3:2) ;
    11. '*' : Writeln (a:3:2,' ',op,' ',b:3:2,' = ',a*b:3:2) ;
    12. '/' : IF b = 0 Then Writeln ('impossible') Else Writeln (a:3:2,' ',op,' ',b:3:2,' = ',a/b:3:2);
    13. Else Writeln ('Opérateur incorrect');
    14. End;
    15. End.

0 commentaires:

Enregistrer un commentaire

Page Facebook

Turbo Pascal 32 bits

Turbo Pascal 64 bits