Accueil     Soft. MacOSX     Soft. MacOS/PC     PHP     Python     ROMS GBA     TP d'info     DBZ-GT     Martingales     Galeries     Liens     @  

Exercice 2-3-4

program calculateur;
var
opd1, opd2: real;
oper: char;
 
begin
writeln(' http://www.Software-DS.com');
writeln;
writeln('Entrez deux operandes');
writeln;
writeln('opd1=');
readln(opd1);
writeln('opd2=');
readln(opd2);
 
writeln('Votre operateur ? (+ - * /)');
readln(oper);
 
case oper of
'+':
writeln(opd1, '+', opd2, ' = ', opd1 + opd2 : 2);
'-':
writeln(opd1, '-', opd2, ' = ', opd1 - opd2 : 2);
'*':
writeln(opd1, '*', opd2, ' = ', opd1 * opd2 : 2);
'/':
if opd2 = 0 then
writeln('Division par zero impossible !')
else
writeln(opd1, '/', opd2, ' = ', opd1 / opd2 : 2 : 3);
 
otherwise
{ Sur PC otherwise n'existe pas, mettre: else }
writeln('operateur ', oper, ' non defini');
end;
 
{ ©2001 All Rights Reserved to http://www.Software-DS.com 26/09/01 }
end.

Retour

Page d'Accueil
Apple





Haut de la page - Page précédente - Page générée en 0.00865 sec.
Recherche personnalisée
 

1843275 visiteurs.   ©2001-2023 All Rights Reserved to Software-DS.com
Made with a mac  
Confidentialité